combine_one_store_into_ancient takes 1 append vec (#29560)

This commit is contained in:
Jeff Washington (jwash) 2023-01-09 10:09:38 -06:00 committed by GitHub
parent 8db1f53fe7
commit a171402e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -4384,10 +4384,9 @@ impl AccountsDb {
); );
} }
let old_storages = [old_storage];
self.combine_one_store_into_ancient( self.combine_one_store_into_ancient(
slot, slot,
&old_storages, &old_storage,
&mut current_ancient, &mut current_ancient,
&mut ancient_slot_pubkeys, &mut ancient_slot_pubkeys,
&mut dropped_roots, &mut dropped_roots,
@ -4408,18 +4407,18 @@ impl AccountsDb {
} }
} }
/// put entire alive contents of 'old_storages' into the current ancient append vec or a newly created ancient append vec /// put entire alive contents of 'old_storage' into the current ancient append vec or a newly created ancient append vec
fn combine_one_store_into_ancient( fn combine_one_store_into_ancient(
&self, &self,
slot: Slot, slot: Slot,
old_storages: &[Arc<AccountStorageEntry>], old_storage: &Arc<AccountStorageEntry>,
current_ancient: &mut CurrentAncientAppendVec, current_ancient: &mut CurrentAncientAppendVec,
ancient_slot_pubkeys: &mut AncientSlotPubkeys, ancient_slot_pubkeys: &mut AncientSlotPubkeys,
dropped_roots: &mut Vec<Slot>, dropped_roots: &mut Vec<Slot>,
) { ) {
let mut stored_accounts = Vec::default(); let mut stored_accounts = Vec::default();
let shrink_collect = self.shrink_collect( let shrink_collect = self.shrink_collect(
old_storages.iter(), std::iter::once(old_storage),
&mut stored_accounts, &mut stored_accounts,
&self.shrink_ancient_stats.shrink_stats, &self.shrink_ancient_stats.shrink_stats,
); );
@ -17312,7 +17311,7 @@ pub mod tests {
let mut dropped_roots = Vec::default(); let mut dropped_roots = Vec::default();
db.combine_one_store_into_ancient( db.combine_one_store_into_ancient(
next_slot, next_slot,
&[db.get_storage_for_slot(next_slot).unwrap()], &db.get_storage_for_slot(next_slot).unwrap(),
&mut current_ancient, &mut current_ancient,
&mut AncientSlotPubkeys::default(), &mut AncientSlotPubkeys::default(),
&mut dropped_roots, &mut dropped_roots,