From c40e88aef971fd78f608844c654503650e38f3cc Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 13 Sep 2023 09:28:19 -0400 Subject: [PATCH] Adds metrics for fastboot storages kept alive (#33222) --- core/src/accounts_hash_verifier.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index 3e453d4360..cb87cdc513 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -64,7 +64,7 @@ impl AccountsHashVerifier { // To support fastboot, we must ensure the storages used in the latest POST snapshot are // not recycled nor removed early. Hold an Arc of their AppendVecs to prevent them from // expiring. - let mut last_snapshot_storages = None; + let mut fastboot_storages = None; loop { if exit.load(Ordering::Relaxed) { break; @@ -92,6 +92,7 @@ impl AccountsHashVerifier { .is_some() .then(|| accounts_package.snapshot_storages.clone()); + let slot = accounts_package.slot; let (_, handling_time_us) = measure_us!(Self::process_accounts_package( accounts_package, &cluster_info, @@ -103,7 +104,13 @@ impl AccountsHashVerifier { )); if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot { - last_snapshot_storages = Some(snapshot_storages_for_fastboot) + let num_storages = snapshot_storages_for_fastboot.len(); + fastboot_storages = Some(snapshot_storages_for_fastboot); + datapoint_info!( + "fastboot", + ("slot", slot, i64), + ("num_storages", num_storages, i64), + ); } datapoint_info!( @@ -122,14 +129,14 @@ impl AccountsHashVerifier { ("handling_time_us", handling_time_us, i64), ); } + info!("AccountsHashVerifier has stopped"); debug!( - "Number of snapshot storages kept alive for fastboot: {}", - last_snapshot_storages + "Number of storages kept alive for fastboot: {}", + fastboot_storages .as_ref() .map(|storages| storages.len()) .unwrap_or(0) ); - info!("AccountsHashVerifier has stopped"); }) .unwrap(); Self {