Clear the account paths before constructing a bank from a snapshot dir (#31170)
This commit is contained in:
parent
6835ceeef5
commit
78d061a3d3
|
@ -1671,6 +1671,12 @@ pub fn bank_from_snapshot_dir(
|
||||||
accounts_update_notifier: Option<AccountsUpdateNotifier>,
|
accounts_update_notifier: Option<AccountsUpdateNotifier>,
|
||||||
exit: &Arc<AtomicBool>,
|
exit: &Arc<AtomicBool>,
|
||||||
) -> Result<(Bank, BankFromDirTimings)> {
|
) -> Result<(Bank, BankFromDirTimings)> {
|
||||||
|
// Clear the contents of the account paths run directories. When constructing the bank, the appendvec
|
||||||
|
// files will be extracted from the snapshot hardlink directories into these run/ directories.
|
||||||
|
for path in account_paths {
|
||||||
|
delete_contents_of_path(path);
|
||||||
|
}
|
||||||
|
|
||||||
let next_append_vec_id = Arc::new(AtomicAppendVecId::new(0));
|
let next_append_vec_id = Arc::new(AtomicAppendVecId::new(0));
|
||||||
|
|
||||||
let (storage, measure_build_storage) = measure!(
|
let (storage, measure_build_storage) = measure!(
|
||||||
|
@ -5430,12 +5436,6 @@ mod tests {
|
||||||
let bank_snapshot = get_highest_bank_snapshot(bank_snapshots_dir).unwrap();
|
let bank_snapshot = get_highest_bank_snapshot(bank_snapshots_dir).unwrap();
|
||||||
let account_paths = &bank.rc.accounts.accounts_db.paths;
|
let account_paths = &bank.rc.accounts.accounts_db.paths;
|
||||||
|
|
||||||
// Clear the contents of the account paths run directories. When constructing the bank, the appendvec
|
|
||||||
// files will be extracted from the snapshot hardlink directories into these run/ directories.
|
|
||||||
for path in account_paths {
|
|
||||||
delete_contents_of_path(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
let (bank_constructed, ..) = bank_from_snapshot_dir(
|
let (bank_constructed, ..) = bank_from_snapshot_dir(
|
||||||
account_paths,
|
account_paths,
|
||||||
&bank_snapshot,
|
&bank_snapshot,
|
||||||
|
|
Loading…
Reference in New Issue