From 79b40f193ab3c9c24f8d512d4560f40e5ad775b7 Mon Sep 17 00:00:00 2001 From: HaoranYi <219428+HaoranYi@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:46:27 -0500 Subject: [PATCH] accounts-db: silence false positive info in shrink (#2831) * log for all zero in shrink * pr: refactor to remove duplicated message logging * pr: only long when all_are_zero = false * pr: update log text * revert log text --------- Co-authored-by: HaoranYi --- accounts-db/src/accounts_db.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 7d934e5adbe586..ab41e4e8f07c16 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -4355,11 +4355,15 @@ impl AccountsDb { // clean needs to take care of this dead slot self.accounts_index.add_uncleaned_roots([slot]); } - info!( - "Unexpected shrink for slot {} alive {} capacity {}, \ - likely caused by a bug for calculating alive bytes.", - slot, shrink_collect.alive_total_bytes, shrink_collect.capacity - ); + + if !shrink_collect.all_are_zero_lamports { + // if all are zero lamports, then we expect that we would like to mark the whole slot dead, but we cannot. That's clean's job. + info!( + "Unexpected shrink for slot {} alive {} capacity {}, \ + likely caused by a bug for calculating alive bytes.", + slot, shrink_collect.alive_total_bytes, shrink_collect.capacity + ); + } self.shrink_stats .skipped_shrink