Skip to content

Commit

Permalink
ahv: do *not* keep fastboot storages arcs
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Mar 11, 2024
1 parent 3d4031b commit 414e34f
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ impl AccountsHashVerifier {
.name("solAcctHashVer".to_string())
.spawn(move || {
info!("AccountsHashVerifier has started");
// 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 fastboot_storages = None;
loop {
if exit.load(Ordering::Relaxed) {
break;
Expand All @@ -75,40 +71,13 @@ impl AccountsHashVerifier {
info!("handling accounts package: {accounts_package:?}");
let enqueued_time = accounts_package.enqueued.elapsed();

// If this accounts package is for a snapshot, then clone the storages to
// save for fastboot.
let snapshot_storages_for_fastboot = accounts_package
.snapshot_info
.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,
snapshot_package_sender.as_ref(),
&snapshot_config,
&exit,
));

if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot {
// 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_total", num_storages_total, i64),
("num_storages_kept_alive", num_storages_kept_alive, i64),
);
}

datapoint_info!(
"accounts_hash_verifier",
(
Expand All @@ -126,13 +95,6 @@ impl AccountsHashVerifier {
);
}
info!("AccountsHashVerifier has stopped");
debug!(
"Number of storages kept alive for fastboot: {}",
fastboot_storages
.as_ref()
.map(|storages| storages.len())
.unwrap_or(0)
);
})
.unwrap();
Self {
Expand Down

0 comments on commit 414e34f

Please sign in to comment.