slots_per_epoch shouldn't be optional (#27256)
This commit is contained in:
parent
7fda0287cb
commit
9d5029da15
|
@ -6664,20 +6664,18 @@ impl AccountsDb {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// storages are sorted by slot and have range info.
|
/// storages are sorted by slot and have range info.
|
||||||
/// if we know slots_per_epoch, then add all stores older than slots_per_epoch to dirty_stores so clean visits these slots
|
/// add all stores older than slots_per_epoch to dirty_stores so clean visits these slots
|
||||||
fn mark_old_slots_as_dirty(&self, storages: &SortedStorages, slots_per_epoch: Option<Slot>) {
|
fn mark_old_slots_as_dirty(&self, storages: &SortedStorages, slots_per_epoch: Slot) {
|
||||||
if let Some(slots_per_epoch) = slots_per_epoch {
|
let max = storages.max_slot_inclusive();
|
||||||
let max = storages.max_slot_inclusive();
|
let acceptable_straggler_slot_count = 100; // do nothing special for these old stores which will likely get cleaned up shortly
|
||||||
let acceptable_straggler_slot_count = 100; // do nothing special for these old stores which will likely get cleaned up shortly
|
let sub = slots_per_epoch + acceptable_straggler_slot_count;
|
||||||
let sub = slots_per_epoch + acceptable_straggler_slot_count;
|
let in_epoch_range_start = max.saturating_sub(sub);
|
||||||
let in_epoch_range_start = max.saturating_sub(sub);
|
for (slot, storages) in storages.iter_range(..in_epoch_range_start) {
|
||||||
for (slot, storages) in storages.iter_range(..in_epoch_range_start) {
|
if let Some(storages) = storages {
|
||||||
if let Some(storages) = storages {
|
storages.iter().for_each(|store| {
|
||||||
storages.iter().for_each(|store| {
|
self.dirty_stores
|
||||||
self.dirty_stores
|
.insert((slot, store.append_vec_id()), store.clone());
|
||||||
.insert((slot, store.append_vec_id()), store.clone());
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6916,7 +6914,7 @@ impl AccountsDb {
|
||||||
"cannot accurately capture all data for debugging if accounts cache is being used"
|
"cannot accurately capture all data for debugging if accounts cache is being used"
|
||||||
);
|
);
|
||||||
|
|
||||||
self.mark_old_slots_as_dirty(storages, Some(config.epoch_schedule.slots_per_epoch));
|
self.mark_old_slots_as_dirty(storages, config.epoch_schedule.slots_per_epoch);
|
||||||
|
|
||||||
let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes);
|
let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes);
|
||||||
let use_bg_thread_pool = config.use_bg_thread_pool;
|
let use_bg_thread_pool = config.use_bg_thread_pool;
|
||||||
|
|
Loading…
Reference in New Issue