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

Commit

Permalink
v1.16: Skip shrink until startup verification is complete (backport of
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 30, 2023
1 parent 302238b commit d63fc61
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,16 @@ impl AccountsBackgroundService {
bank.clean_accounts(last_full_snapshot_slot);
last_cleaned_block_height = bank.block_height();
}
bank.shrink_candidate_slots();
// Do not 'shrink' until *after* the startup verification is complete.
// This is because startup verification needs to get the snapshot
// storages *as they existed at startup* (to calculate the accounts hash).
// If 'shrink' were to run, then it is possible startup verification
// (1) could race with 'shrink', and fail to assert that shrinking is not in
// progress, or (2) could get snapshot storages that were newer than what
// was in the snapshot itself.
if bank.is_startup_verification_complete() {
bank.shrink_candidate_slots();
}
}
stats.record_and_maybe_submit(start_time.elapsed());
sleep(Duration::from_millis(INTERVAL_MS));
Expand Down

0 comments on commit d63fc61

Please sign in to comment.