From 0ca8239ef7184a73eb9948f66da3b60cb37d3811 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Sat, 13 Aug 2022 15:38:41 -0500 Subject: [PATCH] don't log when there is no work to do for combining ancient slots (#26925) --- runtime/src/accounts_db.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index fd57db023e..4d28a7a5ba 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -3731,14 +3731,7 @@ impl AccountsDb { let mut current_ancient = None; let mut dropped_roots = vec![]; - if let Some(first_slot) = sorted_slots.first() { - info!( - "ancient_append_vec: combine_ancient_slots first slot: {}, num_roots: {}", - first_slot, - sorted_slots.len() - ); - } - + let len = sorted_slots.len(); for slot in sorted_slots { let old_storages = match self.get_storages_to_move_to_ancient_append_vec(slot, &mut current_ancient) { @@ -3751,7 +3744,11 @@ impl AccountsDb { if guard.is_none() { // we are now doing interesting work in squashing ancient - guard = Some(self.active_stats.activate(ActiveStatItem::SquashAncient)) + guard = Some(self.active_stats.activate(ActiveStatItem::SquashAncient)); + info!( + "ancient_append_vec: combine_ancient_slots first slot: {}, num_roots: {}", + slot, len + ); } // this code is copied from shrink. I would like to combine it into a helper function, but the borrow checker has defeated my efforts so far.