-
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
v2.0: Startup only sets latest_full_snapshot_slot if generating snapshots (backport of #3633) #3667
Conversation
Cherry-pick of 4ea10c2 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
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
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
// If we're not generating snapshots, ensure ABS's last full snapshot slot is None to | ||
// ensure we handle zero lamport accounts correctly. |
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.
this comment implies that there is yet more implicit logic in this area? can we just eliminate it?
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.
can we just eliminate it?
What is the "it" here?
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.
This is an automatic backport of pull request #3633 done by Mergify.