Skip to content

Commit

Permalink
Adds metrics when purging banks with the same slot (solana-labs#33153)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Sep 6, 2023
1 parent 904b2a7 commit d921b9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,18 @@ impl PrunedBanksRequestHandler {
let grouped_banks_to_purge: Vec<_> =
GroupBy::new(banks_to_purge.as_slice(), |a, b| a.0 == b.0).collect();

// Log whenever we need to handle banks with the same slot. Purposely do this *before* we
// call `purge_slot()` to ensure we get the datapoint (in case there's an assert/panic).
let num_banks_with_same_slot =
num_banks_to_purge.saturating_sub(grouped_banks_to_purge.len());
if num_banks_with_same_slot > 0 {
datapoint_info!(
"pruned_banks_request_handler",
("num_pruned_banks", num_banks_to_purge, i64),
("num_banks_with_same_slot", num_banks_with_same_slot, i64),
);
}

// Purge all the slots in parallel
// Banks for the same slot are purged sequentially
let accounts_db = bank.rc.accounts.accounts_db.as_ref();
Expand Down

0 comments on commit d921b9a

Please sign in to comment.