-
Notifications
You must be signed in to change notification settings - Fork 239
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
shrink/ancient pack purge zero lamport accounts #2312
Conversation
c37b35e
to
6c0f2aa
Compare
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.
I still need to review the actual content of the pr... saw these two small nits first
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.
sorry @brooksprumo found a comment typo |
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.
PR looks correct to me.
My understanding is that the current code in master is still correct but not
optimal.
In master, these single-ref zero lamports accounts will be copied into new
storage during shrink, but when next clean starts, it will drop these accounts
nevertheless.
With this PR, we are dropping these accounts earlier and don't wait for the
next round of clean.
Is that understanding correct?
* shrink/ancient pack purge zero lamport accounts * pr feedback * add = * comment * fix comment typo
Problem
when an account has 1 slot list entry and ref_count=1, it can be removed from the index (marked dead) and removed from storages. Currently, shrink and ancient pack operations carry along zero lamport accounts with a single refcount forever. This is not ideal.
Summary of Changes
Shrink and ancient pack do not copy over zero lamport accounts with slot_list=1 and ref_count=1. Since there are no other instances of the account, the account can be removed from the index and the storage. If it is reincarnated after loading a snapshot, clean will delete it again from the index.
Fixes #