From 0732a6c45f6459b98a5bdbf279fae36bff4061ac Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Wed, 3 Aug 2022 10:02:08 -0500 Subject: [PATCH] add 'oldest_root' stat in hash calc (#26896) --- runtime/src/accounts_db.rs | 2 ++ runtime/src/accounts_hash.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index a7a6b538c..fd57db023 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -6886,6 +6886,8 @@ impl AccountsDb { ) -> Result<(Hash, u64), BankHashVerificationError> { let _guard = self.active_stats.activate(ActiveStatItem::Hash); + stats.oldest_root = storages.range().start; + self.mark_old_slots_as_dirty(storages, Some(config.epoch_schedule.slots_per_epoch)); let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes); diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index ee1b96776..c36a95d3e 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -94,6 +94,7 @@ pub struct HashStats { pub rehash_required: AtomicUsize, /// # rehashes that took place and were UNnecessary pub rehash_unnecessary: AtomicUsize, + pub oldest_root: Slot, pub roots_older_than_epoch: AtomicUsize, pub accounts_in_roots_older_than_epoch: AtomicUsize, pub append_vec_sizes_older_than_epoch: AtomicUsize, @@ -218,6 +219,7 @@ impl HashStats { self.roots_older_than_epoch.load(Ordering::Relaxed) as i64, i64 ), + ("oldest_root", self.oldest_root as i64, i64), ( "ancient_append_vecs", self.ancient_append_vecs.load(Ordering::Relaxed) as i64,