Set is_startup=true for exhaustively_free_unused_resource() (#19846)

This commit is contained in:
Brooks Prumo
2021-09-13 18:08:06 -05:00
committed by GitHub
parent f3d3774ff8
commit 3071c4caad

View File

@ -2339,6 +2339,7 @@ impl Bank {
// Should not be called outside of startup, will race with
// concurrent cleaning logic in AccountsBackgroundService
pub fn exhaustively_free_unused_resource(&self, last_full_snapshot_slot: Option<Slot>) {
const IS_STARTUP: bool = true; // this is only called at startup, and we want to use more threads
let mut flush = Measure::start("flush");
// Flush all the rooted accounts. Must be called after `squash()`,
// so that AccountsDb knows what the roots are.
@ -2350,11 +2351,10 @@ impl Bank {
// accounts that were included in the bank delta hash when the bank was frozen,
// and if we clean them here, any newly created snapshot's hash for this bank
// may not match the frozen hash.
self.clean_accounts(true, false, last_full_snapshot_slot);
self.clean_accounts(true, IS_STARTUP, last_full_snapshot_slot);
clean.stop();
let mut shrink = Measure::start("shrink");
const IS_STARTUP: bool = true; // this is only called at startup, and we want to use more threads
self.shrink_all_slots(IS_STARTUP, last_full_snapshot_slot);
shrink.stop();