Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Fixed issue #22124 -- missing historical data if slot updated later.#22193

Merged
lijunwangs merged 2 commits intosolana-labs:masterfrom
lijunwangs:accounts_historical_data_fix
Jan 4, 2022
Merged

Fixed issue #22124 -- missing historical data if slot updated later.#22193
lijunwangs merged 2 commits intosolana-labs:masterfrom
lijunwangs:accounts_historical_data_fix

Conversation

@lijunwangs
Copy link
Copy Markdown
Contributor

Problem

In the account notification via plugin -- some account update with older slots may come after the updates of those with newer slot. It is found the account_audit table misses such updates.

Summary of Changes

In case updates are rejected in the account table because they are "old", directly insert into the account_audit table for keeping historical data.

Fixes #22124

Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the accounts update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

account audit update

}
}

/// Internal function for updating or inserting a single account
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inserting into account_audit table

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2021

Codecov Report

Merging #22193 (7213954) into master (135af08) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

@@            Coverage Diff            @@
##           master   #22193     +/-   ##
=========================================
- Coverage    81.1%    81.0%   -0.1%     
=========================================
  Files         523      523             
  Lines      146478   146521     +43     
=========================================
- Hits       118820   118817      -3     
- Misses      27658    27704     +46     

@carllin
Copy link
Copy Markdown
Contributor

carllin commented Jan 3, 2022

Lijun and I also discussed some possibilities for integration tests to catch future regressions like this.

@lijunwangs lijunwangs merged commit 5b6027b into solana-labs:master Jan 4, 2022
@lijunwangs lijunwangs added the v1.9 label Jan 4, 2022
mergify Bot pushed a commit that referenced this pull request Jan 4, 2022
…22193)

* Fixed issue #22124 -- missing historical data if slot updated later.

* Fixed a couple of comments

(cherry picked from commit 5b6027b)
mergify Bot added a commit that referenced this pull request Jan 4, 2022
…22193) (#22259)

* Fixed issue #22124 -- missing historical data if slot updated later.

* Fixed a couple of comments

(cherry picked from commit 5b6027b)

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
@brooksprumo brooksprumo mentioned this pull request Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgres AccountsDB plugin does not capture all historical account writes

2 participants