Hack to skip cleanup_dead_slots upon snapshot load (#8562)

automerge
This commit is contained in:
mergify[bot]
2020-03-02 10:40:41 -08:00
committed by GitHub
parent 218b02aaf8
commit b38a535c63
3 changed files with 51 additions and 7 deletions

View File

@@ -447,16 +447,18 @@ pub fn bank_from_archive<P: AsRef<Path>>(
let mut snapshot_version = String::new();
File::open(unpacked_version_file).and_then(|mut f| f.read_to_string(&mut snapshot_version))?;
let bank = rebuild_bank_from_snapshots(
let mut bank = rebuild_bank_from_snapshots(
snapshot_version.trim(),
account_paths,
&unpacked_snapshots_dir,
unpacked_accounts_dir,
)?;
bank.work_around_dead_slots_cleaning_bug(true);
if !bank.verify_snapshot_bank() {
panic!("Snapshot bank for slot {} failed to verify", bank.slot());
}
bank.work_around_dead_slots_cleaning_bug(false);
measure.stop();
info!("{}", measure);