Purges all bank snapshots after fastboot (#35350)

This commit is contained in:
Brooks 2024-02-29 14:31:13 -05:00 committed by GitHub
parent 5f54f6a7d9
commit bdc5cceb18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -337,6 +337,15 @@ fn bank_forks_from_snapshot(
source: err,
path: bank_snapshot.snapshot_path(),
})?;
// If the node crashes before taking the next bank snapshot, the next startup will attempt
// to load from the same bank snapshot again. And if `shrink` has run, the account storage
// files that are hard linked in bank snapshot will be *different* than what the bank
// snapshot expects. This would cause the node to crash again. To prevent that, purge all
// the bank snapshots here. In the above scenario, this will cause the node to load from a
// snapshot archive next time, which is safe.
snapshot_utils::purge_old_bank_snapshots(&snapshot_config.bank_snapshots_dir, 0, None);
bank
};