set active state to shrink_ancient when doing intersting work (#25677)
This commit is contained in:
parent
8bb76fcd87
commit
c91fbd289f
|
@ -3555,7 +3555,7 @@ impl AccountsDb {
|
||||||
if sorted_slots.is_empty() {
|
if sorted_slots.is_empty() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let _guard = self.active_stats.activate(ActiveStatItem::SquashAncient);
|
let mut guard = None;
|
||||||
|
|
||||||
// the ancient append vec currently being written to
|
// the ancient append vec currently being written to
|
||||||
let mut current_ancient = None;
|
let mut current_ancient = None;
|
||||||
|
@ -3579,6 +3579,11 @@ impl AccountsDb {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if guard.is_none() {
|
||||||
|
// we are now doing interesting work in squashing ancient
|
||||||
|
guard = Some(self.active_stats.activate(ActiveStatItem::SquashAncient))
|
||||||
|
}
|
||||||
|
|
||||||
// this code is copied from shrink. I would like to combine it into a helper function, but the borrow checker has defeated my efforts so far.
|
// this code is copied from shrink. I would like to combine it into a helper function, but the borrow checker has defeated my efforts so far.
|
||||||
let (stored_accounts, _num_stores, original_bytes) =
|
let (stored_accounts, _num_stores, original_bytes) =
|
||||||
self.get_unique_accounts_from_storages(old_storages.iter());
|
self.get_unique_accounts_from_storages(old_storages.iter());
|
||||||
|
|
Loading…
Reference in New Issue