Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit cc0e9a0

Browse files
v1.17: Logs the number of storages kept alive by fastboot (backport of #34667) (#34670)
Logs the number of storages kept alive by fastboot (#34667) (cherry picked from commit e84974c) Co-authored-by: Brooks <[email protected]>
1 parent 9c09b16 commit cc0e9a0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/src/accounts_hash_verifier.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,21 @@ impl AccountsHashVerifier {
104104
));
105105

106106
if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot {
107-
let num_storages = snapshot_storages_for_fastboot.len();
107+
// Get the number of storages that are being kept alive for fastboot.
108+
// Looking at the storage Arc's strong reference count, we know that one
109+
// ref is for fastboot, and one ref is for snapshot packaging. If there
110+
// are no others, then the storage will be kept alive because of fastboot.
111+
let num_storages_kept_alive = snapshot_storages_for_fastboot
112+
.iter()
113+
.filter(|storage| Arc::strong_count(storage) == 2)
114+
.count();
115+
let num_storages_total = snapshot_storages_for_fastboot.len();
108116
fastboot_storages = Some(snapshot_storages_for_fastboot);
109117
datapoint_info!(
110118
"fastboot",
111119
("slot", slot, i64),
112-
("num_storages", num_storages, i64),
120+
("num_storages_total", num_storages_total, i64),
121+
("num_storages_kept_alive", num_storages_kept_alive, i64),
113122
);
114123
}
115124

0 commit comments

Comments
 (0)