Skip to content

Commit

Permalink
rebasing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Feb 2, 2023
1 parent 3aeb511 commit 0e12408
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 0 additions & 2 deletions core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ fn test_concurrent_snapshot_packaging(
&storages,
snapshot_version,
slot_deltas,
false,
)
.unwrap();

Expand Down Expand Up @@ -428,7 +427,6 @@ fn test_concurrent_snapshot_packaging(
&snapshot_storages,
snapshot_config.snapshot_version,
slot_deltas,
false,
)
.unwrap();
let accounts_package = AccountsPackage::new_for_snapshot(
Expand Down
1 change: 0 additions & 1 deletion runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ impl SnapshotRequestHandler {
&snapshot_storages,
self.snapshot_config.snapshot_version,
status_cache_slot_deltas,
false,
)
.expect("snapshot bank");
AccountsPackage::new_for_snapshot(
Expand Down
26 changes: 13 additions & 13 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,6 @@ pub fn add_bank_snapshot(
snapshot_storages: &[Arc<AccountStorageEntry>],
snapshot_version: SnapshotVersion,
slot_deltas: Vec<BankSlotDelta>,
dir_full_state: bool,
) -> Result<BankSnapshotInfo> {
let mut add_snapshot_time = Measure::start("add-snapshot-ms");
let slot = bank.slot();
Expand Down Expand Up @@ -2333,16 +2332,18 @@ pub fn verify_snapshot_archive<P, Q, R>(
}
std::fs::remove_dir_all(accounts_hardlinks_dir).unwrap();
}

// Remove the new accounts/ to be consistent with the
// old archive structure.
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
// requires the job to be done.
// This is for test only, so the performance is not an issue.
std::fs::remove_dir_all(accounts_path).unwrap();
}
}
// Remove the new accounts/ to be consistent with the
// old archive structure.
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
// requires the job to be done.
// This is for test only, so the performance is not an issue.
std::fs::remove_dir_all(accounts_path).unwrap();
}

assert!(!dir_diff::is_different(&snapshots_to_verify, unpacked_snapshots).unwrap());

// In the unarchiving case, there is an extra empty "accounts" directory. The account
Expand Down Expand Up @@ -2429,7 +2430,6 @@ pub fn bank_to_full_snapshot_archive(
&snapshot_storages,
snapshot_version,
slot_deltas,
false,
)?;

package_and_archive_full_snapshot(
Expand Down Expand Up @@ -2483,7 +2483,6 @@ pub fn bank_to_incremental_snapshot_archive(
&snapshot_storages,
snapshot_version,
slot_deltas,
false,
)?;

package_and_archive_incremental_snapshot(
Expand Down Expand Up @@ -4402,12 +4401,13 @@ mod tests {

let snapshot_version = SnapshotVersion::default();
let snapshot_storages = bank.get_snapshot_storages(None);

let slot_deltas = bank.status_cache.read().unwrap().root_slot_deltas();
add_bank_snapshot(
&bank_snapshots_dir,
&bank,
&snapshot_storages,
snapshot_version,
slot_deltas,
)
.unwrap();

Expand Down

0 comments on commit 0e12408

Please sign in to comment.