Skip to content

Commit

Permalink
v1.17: Logs the number of storages kept alive by fastboot (backport of
Browse files Browse the repository at this point in the history
…#34667) (#34670)

Logs the number of storages kept alive by fastboot (#34667)

(cherry picked from commit e84974c)

Co-authored-by: Brooks <[email protected]>
  • Loading branch information
mergify[bot] and brooksprumo authored Jan 5, 2024
1 parent 9c09b16 commit cc0e9a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,21 @@ impl AccountsHashVerifier {
));

if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot {
let num_storages = snapshot_storages_for_fastboot.len();
// Get the number of storages that are being kept alive for fastboot.
// Looking at the storage Arc's strong reference count, we know that one
// ref is for fastboot, and one ref is for snapshot packaging. If there
// are no others, then the storage will be kept alive because of fastboot.
let num_storages_kept_alive = snapshot_storages_for_fastboot
.iter()
.filter(|storage| Arc::strong_count(storage) == 2)
.count();
let num_storages_total = snapshot_storages_for_fastboot.len();
fastboot_storages = Some(snapshot_storages_for_fastboot);
datapoint_info!(
"fastboot",
("slot", slot, i64),
("num_storages", num_storages, i64),
("num_storages_total", num_storages_total, i64),
("num_storages_kept_alive", num_storages_kept_alive, i64),
);
}

Expand Down

0 comments on commit cc0e9a0

Please sign in to comment.