Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Backport Accounts Fixes #16838 and the test #17038 #19412

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Aug 25, 2021

Problem

See #16838. Fix was not backported to 1.6

Summary of Changes

Backport #16838 and #17038
Fixes #

jeffwashington and others added 2 commits August 24, 2021 17:50
* Use ReclaimResult::Default() instead of building subtypes

* Add test to ensure account_db store and index are aligned
@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #19412 (d951a0e) into v1.6 (45e3cd3) will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##             v1.6   #19412     +/-   ##
=========================================
- Coverage    82.2%    82.2%   -0.1%     
=========================================
  Files         423      423             
  Lines      118114   118146     +32     
=========================================
+ Hits        97197    97222     +25     
- Misses      20917    20924      +7     

Copy link
Contributor

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm. Includes a few renames that are unnecessary, but ok.

@jeffwashington
Copy link
Contributor

I confirmed that this change, cherry-picked to 1.6 stops us accumulating old storages several million slots in the past.
#19320

@jeffwashington jeffwashington requested a review from mvines August 25, 2021 21:40
@carllin carllin merged commit 7956f04 into solana-labs:v1.6 Aug 25, 2021
@@ -1181,31 +1181,30 @@ impl AccountsDb {
// Reclaim older states of rooted accounts for AccountsDb bloat mitigation
fn clean_old_rooted_accounts(
&self,
purges_in_root: Vec<Pubkey>,
purges: Vec<Pubkey>,
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes are just cosmetic, right? I can't find a logical difference. Is this PR truly for the test added?

Copy link
Contributor

Choose a reason for hiding this comment

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

@lijunwangs see my comment to you below and this:
#16838

@@ -1599,7 +1598,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);
Copy link
Contributor

Choose a reason for hiding this comment

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

@lijunwangs this is the point of the change. We pass Some() into handle_reclaims.
The test is the other functional change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it!

@jeffwashington
Copy link
Contributor

lijun-dev2, devnet 1.6 with backport of just jwash's clean bug fix + logging:
https://github.com/jeffwashington/solana/tree/log2343
summary: staying near 432k range of slots:
range before scan: 432108
range before scan: 432101
range before scan: 432104
range before scan: 432120

lijun-dev2, devnet 1.6 with just logging:
range before scan: 2464539
range before scan: 2464651
range before scan: 2464760
range before scan: 2464883
range before scan: 2464999
range before scan: 2465107

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants