Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Purges all bank snapshots after fastboot
Browse files Browse the repository at this point in the history
brooksprumo committed Feb 28, 2024

Verified

This commit was signed with the committer’s verified signature.
brooksprumo Brooks
1 parent 8ad125d commit 35546ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ledger/src/bank_forks_utils.rs
Original file line number Diff line number Diff line change
@@ -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 exists. 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_all_bank_snapshots(&snapshot_config.bank_snapshots_dir);

bank
};

0 comments on commit 35546ca

Please sign in to comment.