Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs the number of storages kept alive by fastboot #34667

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought about naming this num_storages_unique, but I wasn't confident that would be sufficient clear to others without looking at the code. Let me know if there's a better name.

);
}

Expand Down