add metric for ancient can't move slots (#33713)
* add metric for ancient can't move slots * rename * fix erors in replacing text * rename
This commit is contained in:
parent
b241cef813
commit
5de9163625
|
@ -2014,10 +2014,10 @@ pub(crate) struct ShrinkStatsSub {
|
||||||
pub(crate) store_accounts_timing: StoreAccountsTiming,
|
pub(crate) store_accounts_timing: StoreAccountsTiming,
|
||||||
pub(crate) rewrite_elapsed_us: u64,
|
pub(crate) rewrite_elapsed_us: u64,
|
||||||
pub(crate) create_and_insert_store_elapsed_us: u64,
|
pub(crate) create_and_insert_store_elapsed_us: u64,
|
||||||
|
pub(crate) unpackable_slots_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ShrinkStatsSub {
|
impl ShrinkStatsSub {
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn accumulate(&mut self, other: &Self) {
|
pub(crate) fn accumulate(&mut self, other: &Self) {
|
||||||
self.store_accounts_timing
|
self.store_accounts_timing
|
||||||
.accumulate(&other.store_accounts_timing);
|
.accumulate(&other.store_accounts_timing);
|
||||||
|
@ -2026,6 +2026,7 @@ impl ShrinkStatsSub {
|
||||||
self.create_and_insert_store_elapsed_us,
|
self.create_and_insert_store_elapsed_us,
|
||||||
other.create_and_insert_store_elapsed_us
|
other.create_and_insert_store_elapsed_us
|
||||||
);
|
);
|
||||||
|
saturating_add_assign!(self.unpackable_slots_count, other.unpackable_slots_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2041,6 +2042,7 @@ pub struct ShrinkStats {
|
||||||
handle_reclaims_elapsed: AtomicU64,
|
handle_reclaims_elapsed: AtomicU64,
|
||||||
remove_old_stores_shrink_us: AtomicU64,
|
remove_old_stores_shrink_us: AtomicU64,
|
||||||
rewrite_elapsed: AtomicU64,
|
rewrite_elapsed: AtomicU64,
|
||||||
|
unpackable_slots_count: AtomicU64,
|
||||||
drop_storage_entries_elapsed: AtomicU64,
|
drop_storage_entries_elapsed: AtomicU64,
|
||||||
recycle_stores_write_elapsed: AtomicU64,
|
recycle_stores_write_elapsed: AtomicU64,
|
||||||
accounts_removed: AtomicUsize,
|
accounts_removed: AtomicUsize,
|
||||||
|
@ -2219,6 +2221,13 @@ impl ShrinkAncientStats {
|
||||||
self.shrink_stats.rewrite_elapsed.swap(0, Ordering::Relaxed) as i64,
|
self.shrink_stats.rewrite_elapsed.swap(0, Ordering::Relaxed) as i64,
|
||||||
i64
|
i64
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"unpackable_slots_count",
|
||||||
|
self.shrink_stats
|
||||||
|
.unpackable_slots_count
|
||||||
|
.swap(0, Ordering::Relaxed) as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"drop_storage_entries_elapsed",
|
"drop_storage_entries_elapsed",
|
||||||
self.shrink_stats
|
self.shrink_stats
|
||||||
|
@ -4177,6 +4186,9 @@ impl AccountsDb {
|
||||||
shrink_stats
|
shrink_stats
|
||||||
.rewrite_elapsed
|
.rewrite_elapsed
|
||||||
.fetch_add(stats_sub.rewrite_elapsed_us, Ordering::Relaxed);
|
.fetch_add(stats_sub.rewrite_elapsed_us, Ordering::Relaxed);
|
||||||
|
shrink_stats
|
||||||
|
.unpackable_slots_count
|
||||||
|
.fetch_add(stats_sub.unpackable_slots_count as u64, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// get stores for 'slot'
|
/// get stores for 'slot'
|
||||||
|
|
|
@ -299,6 +299,7 @@ impl AccountsDb {
|
||||||
);
|
);
|
||||||
|
|
||||||
let accounts_to_combine = self.calc_accounts_to_combine(&accounts_per_storage);
|
let accounts_to_combine = self.calc_accounts_to_combine(&accounts_per_storage);
|
||||||
|
metrics.unpackable_slots_count += accounts_to_combine.unpackable_slots_count;
|
||||||
|
|
||||||
// pack the accounts with 1 ref
|
// pack the accounts with 1 ref
|
||||||
let pack = PackedAncientStorage::pack(
|
let pack = PackedAncientStorage::pack(
|
||||||
|
@ -385,6 +386,7 @@ impl AccountsDb {
|
||||||
store_accounts_timing,
|
store_accounts_timing,
|
||||||
rewrite_elapsed_us,
|
rewrite_elapsed_us,
|
||||||
create_and_insert_store_elapsed_us,
|
create_and_insert_store_elapsed_us,
|
||||||
|
unpackable_slots_count: 0,
|
||||||
});
|
});
|
||||||
write_ancient_accounts
|
write_ancient_accounts
|
||||||
.shrinks_in_progress
|
.shrinks_in_progress
|
||||||
|
@ -584,6 +586,7 @@ impl AccountsDb {
|
||||||
target_slots_sorted.push(info.slot);
|
target_slots_sorted.push(info.slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let unpackable_slots_count = remove.len();
|
||||||
remove.into_iter().rev().for_each(|i| {
|
remove.into_iter().rev().for_each(|i| {
|
||||||
accounts_to_combine.remove(i);
|
accounts_to_combine.remove(i);
|
||||||
});
|
});
|
||||||
|
@ -591,6 +594,7 @@ impl AccountsDb {
|
||||||
accounts_to_combine,
|
accounts_to_combine,
|
||||||
accounts_keep_slots,
|
accounts_keep_slots,
|
||||||
target_slots_sorted,
|
target_slots_sorted,
|
||||||
|
unpackable_slots_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,6 +722,8 @@ struct AccountsToCombine<'a> {
|
||||||
/// Some of these slots will have ancient append vecs created at them to contain everything in 'accounts_to_combine'
|
/// Some of these slots will have ancient append vecs created at them to contain everything in 'accounts_to_combine'
|
||||||
/// The rest will become dead slots with no accounts in them.
|
/// The rest will become dead slots with no accounts in them.
|
||||||
target_slots_sorted: Vec<Slot>,
|
target_slots_sorted: Vec<Slot>,
|
||||||
|
/// when scanning, this many slots contained accounts that could not be packed because accounts with ref_count > 1 existed.
|
||||||
|
unpackable_slots_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -3135,6 +3141,7 @@ pub mod tests {
|
||||||
accounts_keep_slots: HashMap::default(),
|
accounts_keep_slots: HashMap::default(),
|
||||||
accounts_to_combine: vec![shrink_collect],
|
accounts_to_combine: vec![shrink_collect],
|
||||||
target_slots_sorted: Vec::default(),
|
target_slots_sorted: Vec::default(),
|
||||||
|
unpackable_slots_count: 0,
|
||||||
};
|
};
|
||||||
db.addref_accounts_failed_to_shrink_ancient(accounts_to_combine);
|
db.addref_accounts_failed_to_shrink_ancient(accounts_to_combine);
|
||||||
db.accounts_index.scan(
|
db.accounts_index.scan(
|
||||||
|
|
Loading…
Reference in New Issue