abs: Update last_full_snapshot_slot before calling clean_accounts() (#27940)

This commit is contained in:
Brooks Prumo 2022-10-03 09:34:13 -04:00 committed by GitHub
parent c2bb2b8e60
commit 5d044ccb34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -170,6 +170,10 @@ impl SnapshotRequestHandler {
// we should not rely on the state of this validator until startup verification is complete (unless handling an EAH request)
assert!(snapshot_root_bank.is_startup_verification_complete() || request_type == SnapshotRequestType::EpochAccountsHash);
if accounts_package_type == AccountsPackageType::Snapshot(SnapshotType::FullSnapshot) {
*last_full_snapshot_slot = Some(snapshot_root_bank.slot());
}
let previous_hash = if test_hash_calculation {
// We have to use the index version here.
// We cannot calculate the non-index way because cache has not been flushed and stores don't match reality. This comment is out of date and can be re-evaluated.
@ -242,10 +246,6 @@ impl SnapshotRequestHandler {
shrink_time.stop();
}
if accounts_package_type == AccountsPackageType::Snapshot(SnapshotType::FullSnapshot) {
*last_full_snapshot_slot = Some(snapshot_root_bank.slot());
}
// Snapshot the bank and send over an accounts package
let mut snapshot_time = Measure::start("snapshot_time");
let result = snapshot_utils::snapshot_bank(