Skip to content

Commit 71206ab

Browse files
committed
do not delete snapshot before the consistency check
1 parent ff73ad3 commit 71206ab

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ impl ProcessManager {
115115
let source_storage_dir = PathBuf::from(&self.working_dir).join("storage");
116116

117117
if backup_exists {
118-
fs::remove_dir_all(backup_dir_path)
119-
.await
120-
.with_context(|| format!("failed to remove backup storage dir {backup_dir_path:?}"))?;
118+
fs::remove_dir_all(backup_dir_path).await.with_context(|| {
119+
format!("failed to remove backup storage dir {backup_dir_path:?}")
120+
})?;
121121
}
122122

123123
util::copy_dir(&source_storage_dir, backup_dir_path).await?;

src/workload.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ impl Workload {
332332
restore_collection_snapshot(&self.collection_name, snapshot_name, http_client)
333333
.await?;
334334

335-
delete_collection_snapshot(client, &self.collection_name, snapshot_name).await?;
336335
let restored_count = get_exact_points_count(client, &self.collection_name).await?;
337336

338337
if restored_count == 0 {
@@ -343,9 +342,14 @@ impl Workload {
343342
log::info!(
344343
"Run: data consistency check over {restored_count} points restored for snapshot '{snapshot_name}'"
345344
);
346-
self.data_consistency_check(client, restored_count, "snapshot-restore-check")
347-
.await?;
348-
345+
self.data_consistency_check(
346+
client,
347+
restored_count,
348+
&format!("snapshot-restore-check-{snapshot_name}"),
349+
)
350+
.await?;
351+
// cleanup
352+
delete_collection_snapshot(client, &self.collection_name, snapshot_name).await?;
349353
delete_points(client, &self.collection_name).await?;
350354
self.reset_max_confirmed_point_id();
351355
}

0 commit comments

Comments
 (0)