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

reclaim unrefs accounts from index #16838

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,9 @@ impl AccountsDb {
// Don't reset from clean, since the pubkeys in those stores may need to be unref'ed
// and those stores may be used for background hashing.
let reset_accounts = false;
self.handle_reclaims(&reclaims, None, false, None, reset_accounts);
let mut reclaim_result = ReclaimResult::default();
let reclaim_result = Some(&mut reclaim_result);
self.handle_reclaims(&reclaims, None, false, reclaim_result, reset_accounts);
Copy link
Contributor

@carllin carllin Apr 27, 2021

Choose a reason for hiding this comment

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

ah shoot, this is because the final finalize_dead_slot_removal only unrefs the pubkey if purged_stored_account_slot.is_some(). This seems like the likely bug.

Looks like I introduced it here to fix a hash mismatch issue: https://github.com/solana-labs/solana/pull/15534/files#diff-1090394420d51617f3233275c2b65ed706b35b53b115fe65f82c682af8134a6fR3958, and didn't plumb it through clean properly, ugh sorry!

Copy link
Contributor

Choose a reason for hiding this comment

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

A good thing to enforce in handle_reclaims() might be that anytime that no_dead_slot == false,, then reclaim_result.is_some() should also be true, because if a slot can be dead, then unrefing must be able to happen.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, this seems right. Good catch @jeffwashington

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#15534 is the introduction of this problem.
Unless I'm mistaken, I see this commit in 1.5 and 1.6.
@mvines @sakridge what do you recommend?


reclaims_time.stop();

Expand Down