-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Startup only sets latest_full_snapshot_slot if generating snapshots #3633
Startup only sets latest_full_snapshot_slot if generating snapshots #3633
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
maybe backport to 2.0?
Yes, we'll backport to v2.1 and v.20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. wow. good catch.
Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. |
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
…hots (backport of #3633) (#3667) * Startup only sets latest_full_snapshot_slot if generating snapshots (#3633) (cherry picked from commit 4ea10c2) # Conflicts: # accounts-db/src/accounts_db.rs # ledger/src/bank_forks_utils.rs * fix backport merge conflict --------- Co-authored-by: Brooks <brooks@anza.xyz>
Problem
AccountsDb uses the latest full snapshot slot to gate how much, and what, to clean/etc. The latest full snapshot slot is updated every time a new full snapshot is taken.
If snapshots are disabled, then the latest full snapshot slot is never updated, and we cannot purge zero lamport accounts past the latest full snapshot slot.
The accounts-db code is aware of this though. If
latest_full_snapshot_slot
is None, we can clean everything. Yay!The problem is that we always set the latest full snapshot slot at startup to Some, thus we never clean zero lamport accounts past the startup full snapshot slot!
Summary of Changes
If we're not generating snapshots, the latest full snapshot slot should be None.