Skip to content

Commit

Permalink
accounts-db: silence false positive info in shrink (#2831)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
HaoranYi and HaoranYi authored Sep 4, 2024
1 parent f2b7ef4 commit 79b40f1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79b40f1

Please sign in to comment.