extract handle_dropped_roots_for_ancient from ancient append vec code (#28611)

This commit is contained in:
Jeff Washington (jwash) 2022-10-27 07:32:04 -07:00 committed by GitHub
parent a2b0d0e6f0
commit 251cab4c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -4520,6 +4520,14 @@ impl AccountsDb {
);
}
self.handle_dropped_roots_for_ancient(dropped_roots);
self.shrink_ancient_stats.report();
}
/// each slot in 'dropped_roots' has been combined into an ancient append vec.
/// We are done with the slot now forever.
fn handle_dropped_roots_for_ancient(&self, dropped_roots: Vec<Slot>) {
if !dropped_roots.is_empty() {
dropped_roots.iter().for_each(|slot| {
self.accounts_index
@ -4537,8 +4545,6 @@ impl AccountsDb {
.is_empty());
});
}
self.shrink_ancient_stats.report();
}
/// add all 'pubkeys' into the set of pubkeys that are 'uncleaned', associated with 'slot'