sadanand48 commented on code in PR #5194:
URL: https://github.com/apache/ozone/pull/5194#discussion_r1298069097


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java:
##########
@@ -329,17 +334,65 @@ public void testRestoreSnapshotDifferentBucketLayout(
       keyCopy(sourcePath + keyPrefix + i, destPath);
     }
 
-    assertDoesNotThrow(() -> waitForKeyCount(buck2, keyPrefix));
+    assertDoesNotThrow(() -> waitForKeyCount(buck2, keyPrefix, 5));
+  }
+
+  @ParameterizedTest
+  @MethodSource("bucketTypes")
+  public void testUnorderedDeletion(BucketLayout bucketLayoutTest)
+          throws Exception {
+    String volume = "vol-" + counter.incrementAndGet();
+    String bucket = "buck-" + counter.incrementAndGet();
+    store.createVolume(volume);
+    OzoneVolume vol = store.getVolume(volume);
+    BucketArgs bucketArgs = BucketArgs.newBuilder()
+            .setBucketLayout(bucketLayoutTest).build();
+    vol.createBucket(bucket, bucketArgs);
+    OzoneBucket buck = vol.getBucket(bucket);
+    // Create Key1 and take snapshot
+
+    String[] key = new String[10];
+    String[] snapshotName = new String[10];
+    String[] snapshotKeyPrefix = new String[10];
+
+    // create 10 incremental snapshots
+    for (int i = 0; i < 10; i++) {
+      key[i] = "key-" + counter.incrementAndGet();
+      snapshotName[i] = "snap-" + counter.incrementAndGet();
+      createFileKey(buck, key[i]);
+      snapshotKeyPrefix[i] = createSnapshot(volume, bucket, snapshotName[i]);
+    }
+
+    // delete multiple snapshots - 2nd, 5th , 8th
+    for (int i = 2; i < 10; i += 3) {
+      store.deleteSnapshot(volume, bucket, snapshotName[i]);
+    }
+
+    // delete all keys in bucket before restoring from snapshot
+    deleteKeys(buck);
+    int delKeyCount = keyCount(buck, "key-");

Review Comment:
   nit : `keyCountAfterDelete` sounds better I guess .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to