Skip to content
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

Reclaims more old accounts in clean #4044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brooksprumo
Copy link

Problem

In clean_accounts(), if there are old storages and old accounts beyond what is expected, we do not always reclaim them. This is because when scanning the candidates during clean, if the account's latest slot in the slot list is not in the uncleaned_roots list, we don't collect reclaims.

This can happen if there are candidates from old/ancient slots, where their newest entry is in a slot that is not being visited by clean. We would find multiple entries for this candidate in the index, yet determine not to collect reclaims.

Summary of Changes

Collect reclaims on candidates that have slot lists greater than one entry, and if they are all cleanable (i.e. rooted).

@brooksprumo brooksprumo self-assigned this Dec 10, 2024
@jeffwashington
Copy link

this looks correct. This seems like we can explain now why the brute force method wasn't working, too. And, since we were handling duplicates on the index correctly when we were starting with the in-mem index only. This seems correct.

Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

Nice find.
looks correct to me.

@brooksprumo
Copy link
Author

I spun up a mnb node with the disk index disabled to see how it performed. Here's some results:

clean always has a lot of work to do on the first iteration. And we see it removing the old slots:
Screenshot 2024-12-10 at 4 57 19 PM

And since we're cleaning up reclaims, shrink can do a better job now too, purging lots of zero lamport accounts:
Screenshot 2024-12-10 at 4 57 56 PM

@brooksprumo brooksprumo marked this pull request as ready for review December 10, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants