This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Call AccountsDb::clean_accounts() directly, inside Bank::verify_snapshot_bank()#27258
Merged
brooksprumo merged 1 commit intosolana-labs:masterfrom Aug 22, 2022
Conversation
90a4b6d to
748ffc6
Compare
748ffc6 to
4e96e43
Compare
4e96e43 to
0a56276
Compare
brooksprumo
commented
Aug 19, 2022
Comment on lines
+7162
to
+7165
| self.rc | ||
| .accounts | ||
| .accounts_db | ||
| .clean_accounts(None, true, Some(last_full_snapshot_slot)); |
Contributor
Author
There was a problem hiding this comment.
Note that previously we'd call clean_accounts() with max_clean_root = Some(self.slot() - 1), and now we call clean_accounts() with max_root = None.
I believe this is safe for the reasons I put in the PR description. Please let me know if I've missed something!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On startup from a snapshot, the bank is verified after deserialization. In that fn,
Bank::verify_snapshot_bank(), it callscleanandshrink. However,cleanandshrinkspecify differentmax_clean_roots. These should be the same.Since were at startup, there's no outstanding scans that could occur, and no reason why we cannot clean all slots. We do need to make sure 0-lamport accounts are still kept around for slots past the last full snapshot, and that behavior has not changed.
See #27200 for full context
Summary of Changes
In
Bank::verify_snapshot_bank(), callAccountsDb::clean_accounts()directly, and setmax_clean_rootstoNone.