Skip to content

Commit

Permalink
Revert "Clear the account paths before constructing a bank from a sna…
Browse files Browse the repository at this point in the history
…pshot dir"

This reverts commit 272bb9f.
  • Loading branch information
xiangzhu70 committed Apr 13, 2023
1 parent 5a737d3 commit ca782dc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1666,12 +1666,6 @@ pub fn bank_from_snapshot_dir(
accounts_update_notifier: Option<AccountsUpdateNotifier>,
exit: &Arc<AtomicBool>,
) -> 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 (storage, measure_build_storage) = measure!(
Expand Down Expand Up @@ -5480,6 +5474,12 @@ mod tests {
let bank_snapshot = get_highest_bank_snapshot(bank_snapshots_dir).unwrap();
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(
account_paths,
&bank_snapshot,
Expand Down Expand Up @@ -5560,6 +5560,11 @@ mod tests {
}

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 deserialized_bank = bank_from_latest_snapshot_dir(
bank_snapshots_dir,
Expand Down

0 comments on commit ca782dc

Please sign in to comment.