Adds metrics for fastboot storages kept alive (#33222)

This commit is contained in:
Brooks 2023-09-13 09:28:19 -04:00 committed by GitHub
parent 5562f79cc5
commit c40e88aef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -64,7 +64,7 @@ impl AccountsHashVerifier {
// To support fastboot, we must ensure the storages used in the latest POST snapshot are // 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 // not recycled nor removed early. Hold an Arc of their AppendVecs to prevent them from
// expiring. // expiring.
let mut last_snapshot_storages = None; let mut fastboot_storages = None;
loop { loop {
if exit.load(Ordering::Relaxed) { if exit.load(Ordering::Relaxed) {
break; break;
@ -92,6 +92,7 @@ impl AccountsHashVerifier {
.is_some() .is_some()
.then(|| accounts_package.snapshot_storages.clone()); .then(|| accounts_package.snapshot_storages.clone());
let slot = accounts_package.slot;
let (_, handling_time_us) = measure_us!(Self::process_accounts_package( let (_, handling_time_us) = measure_us!(Self::process_accounts_package(
accounts_package, accounts_package,
&cluster_info, &cluster_info,
@ -103,7 +104,13 @@ impl AccountsHashVerifier {
)); ));
if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot { 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!( datapoint_info!(
@ -122,14 +129,14 @@ impl AccountsHashVerifier {
("handling_time_us", handling_time_us, i64), ("handling_time_us", handling_time_us, i64),
); );
} }
info!("AccountsHashVerifier has stopped");
debug!( debug!(
"Number of snapshot storages kept alive for fastboot: {}", "Number of storages kept alive for fastboot: {}",
last_snapshot_storages fastboot_storages
.as_ref() .as_ref()
.map(|storages| storages.len()) .map(|storages| storages.len())
.unwrap_or(0) .unwrap_or(0)
); );
info!("AccountsHashVerifier has stopped");
}) })
.unwrap(); .unwrap();
Self { Self {