-
Notifications
You must be signed in to change notification settings - Fork 251
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
Conversation
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. |
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.
Nice find.
looks correct to me.
00458ec
to
eb1b7a0
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.
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.
If max_clean_root_inclusive is none, we need to follow the old rule, i.e. slots must be in self.uncleaned_roots...
Recently, we have seen a few clean related issues with different CLI configuration for validators. I am trying to think carefully about different ways that clean might be broken when the validator is running with different configurations, i.e. w/o disk index; w/o snapshot generation ... |
purges_old_accounts_local += 1; | ||
useless = false; | ||
} | ||
// Note, this next if-block is only kept to maintain the |
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.
seems like we could get rid of this metric code and stat. or at least make it a fn to simplify the code in this more critical code path to make it easier to understand and verify correct. THis can be done later.
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.
Yep, I agree. I'll save it for later to keep this PR small, to make it simpler to backport.
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. |
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 duringclean
, if the account's latest slot in the slot list is not in theuncleaned_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).