diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index bae4526cf539ef..9095a29b19cc50 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -2030,6 +2030,7 @@ pub struct ShrinkStats { alive_accounts: AtomicU64, accounts_loaded: AtomicU64, purged_zero_lamports: AtomicU64, + accounts_not_found_in_index: AtomicU64, } impl ShrinkStats { @@ -2133,6 +2134,11 @@ impl ShrinkStats { self.purged_zero_lamports.swap(0, Ordering::Relaxed), i64 ), + ( + "accounts_not_found_in_index", + self.accounts_not_found_in_index.swap(0, Ordering::Relaxed), + i64 + ), ); } } @@ -2340,6 +2346,13 @@ impl ShrinkAncientStats { .swap(0, Ordering::Relaxed), i64 ), + ( + "accounts_not_found_in_index", + self.shrink_stats + .accounts_not_found_in_index + .swap(0, Ordering::Relaxed), + i64 + ), ); } } @@ -3928,6 +3941,10 @@ impl AccountsDb { alive_accounts.add(ref_count, stored_account, slot_list); alive += 1; } + } else { + stats + .accounts_not_found_in_index + .fetch_add(1, Ordering::Relaxed); } index += 1; result