Skip to content

Commit

Permalink
IoWithSourceAndFile and expanded comments on accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Jan 5, 2023
1 parent b340b53 commit 379df31
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,11 @@ fn hard_link_appendvec_files_to_snapshot(
) -> Result<()> {
let dir_accounts_hard_links = bank_snapshots_dir.as_ref().join("accounts");
fs::create_dir(&dir_accounts_hard_links).map_err(|e| {
let err_msg = format!(
"Error: {}. Failed to create the hard-link dir {}.",
SnapshotError::IoWithSourceAndFile(
e,
dir_accounts_hard_links.display(),
);
SnapshotError::Io(IoError::new(ErrorKind::Other, err_msg))
"create hard-link dir",
dir_accounts_hard_links.clone(),
)
})?;

for slot_storages in snapshot_storages {
Expand Down Expand Up @@ -2187,8 +2186,9 @@ pub fn verify_snapshot_archive<P, Q, R>(
assert!(crate::serde_snapshot::compare_two_serialized_banks(&p1, &p2).unwrap());
std::fs::remove_file(p1).unwrap();
std::fs::remove_file(p2).unwrap();
// Remove the new accounts/ to be consistent with the
// old archive structure.
// Remove the new accounts/ hard-link directory to be consistent with the
// old archive structure, so that the directory comparison checking in the test
// passes.
let accounts_path = snapshot_slot_dir.join("accounts");
if accounts_path.is_dir() {
// Do not use the async move_and_async_delete_path because the assert below
Expand Down

0 comments on commit 379df31

Please sign in to comment.