Skip to content

Commit

Permalink
better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Oct 8, 2024
1 parent 8a9a3ff commit 3d3360e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5120,6 +5120,7 @@ impl AccountsDb {
// for shrinking.
if shrink_slots.len() < 10 {
let mut ancients = self.best_ancient_slots_to_shrink.write().unwrap();
let mut done = false;

for (slot, capacity) in ancients.iter_mut() {
if *capacity == 0 || shrink_slots.contains(slot) {
Expand All @@ -5135,16 +5136,22 @@ impl AccountsDb {
// ignore this one
continue;
}
if done {
log::error!("next ancient storage to shrink: {}, alive: {}, capacity: {}", slot, store.alive_bytes(), store.capacity());
break;
}
*capacity = 0;
ancient_slots_added += 1;
self.shrink_stats
.ancient_bytes_added_to_shrink
.fetch_add(store.alive_bytes() as u64, Ordering::Relaxed);
shrink_slots.insert(*slot, store);

break;
done = true;
}
}
if !done {
log::error!("nothing found to shrink");
}
}
self.shrink_stats
.ancient_slots_added_to_shrink
Expand Down

0 comments on commit 3d3360e

Please sign in to comment.