GeorgeJahad commented on code in PR #3981:
URL: https://github.com/apache/ozone/pull/3981#discussion_r1028566507


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java:
##########
@@ -194,27 +199,57 @@ void testZeroSizeKey()
 
     DifferSnapshotInfo snap1 = getDifferSnapshotInfo(omMetadataManager,
         volumeName, bucketName, "snap1");
-    DifferSnapshotInfo snap3 = getDifferSnapshotInfo(omMetadataManager,
-        volumeName, bucketName, "snap3");
+    DifferSnapshotInfo snap2 = getDifferSnapshotInfo(omMetadataManager,
+        volumeName, bucketName, "snap2");
 
     // RocksDB does checkpointing in a separate thread, wait for it
     final File checkpointSnap1 = new File(snap1.getDbPath());
     GenericTestUtils.waitFor(checkpointSnap1::exists, 2000, 20000);
+    final File checkpointSnap2 = new File(snap2.getDbPath());
+    GenericTestUtils.waitFor(checkpointSnap2::exists, 2000, 20000);
+
+    List<String> actualDiffList21 = differ.getSSTDiffList(snap2, snap1);
+    LOG.debug("Got diff list: {}", actualDiffList21);
+    // Hard-coded expected result.
+    // The result is deterministic. Retrieved from a run.
+//    final List<String> expectedDiffList21 = Arrays.asList(
+//        "000066", "000080", "000087", "000073", "000095");
+//    Assertions.assertEquals(expectedDiffList21, actualDiffList21);

Review Comment:
   Is this test no longer valid?



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java:
##########
@@ -194,27 +199,57 @@ void testZeroSizeKey()
 
     DifferSnapshotInfo snap1 = getDifferSnapshotInfo(omMetadataManager,
         volumeName, bucketName, "snap1");
-    DifferSnapshotInfo snap3 = getDifferSnapshotInfo(omMetadataManager,
-        volumeName, bucketName, "snap3");
+    DifferSnapshotInfo snap2 = getDifferSnapshotInfo(omMetadataManager,
+        volumeName, bucketName, "snap2");
 
     // RocksDB does checkpointing in a separate thread, wait for it
     final File checkpointSnap1 = new File(snap1.getDbPath());
     GenericTestUtils.waitFor(checkpointSnap1::exists, 2000, 20000);
+    final File checkpointSnap2 = new File(snap2.getDbPath());
+    GenericTestUtils.waitFor(checkpointSnap2::exists, 2000, 20000);
+
+    List<String> actualDiffList21 = differ.getSSTDiffList(snap2, snap1);
+    LOG.debug("Got diff list: {}", actualDiffList21);
+    // Hard-coded expected result.
+    // The result is deterministic. Retrieved from a run.
+//    final List<String> expectedDiffList21 = Arrays.asList(
+//        "000066", "000080", "000087", "000073", "000095");
+//    Assertions.assertEquals(expectedDiffList21, actualDiffList21);
+
+    // Delete 1000 keys, take a 3rd snapshot, and do another diff
+    for (int i = 0; i < 1000; i++) {
+      bucket.deleteKey("b_" + i);
+    }
+
+    resp = store.createSnapshot(volumeName, bucketName, "snap3");
+    LOG.debug("Snapshot created: {}", resp);
+
+    DifferSnapshotInfo snap3 = getDifferSnapshotInfo(omMetadataManager,
+        volumeName, bucketName, "snap3");
     final File checkpointSnap3 = new File(snap3.getDbPath());
     GenericTestUtils.waitFor(checkpointSnap3::exists, 2000, 20000);
 
-    List<String> actualDiffList = differ.getSSTDiffList(snap3, snap1);
-    LOG.debug("Got diff list: {}", actualDiffList);
-    // Hard-coded expected output.
-    // The result is deterministic. Retrieved from a successful run.
-    final List<String> expectedDiffList = Collections.singletonList("000059");
-    Assertions.assertEquals(expectedDiffList, actualDiffList);
-
-    // TODO: Use smaller DB write buffer size (currently it is set to 128 MB
-    //  in DBProfile), or generate enough keys (in the millions) to trigger
-    //  RDB compaction. Take another snapshot and do the diff again.
-    //  Then restart OM, do the same diff again to see if DAG reconstruction
-    //  works.
+    List<String> actualDiffList32 = differ.getSSTDiffList(snap3, snap2);
+//    final List<String> expectedDiffList32 = Arrays.asList("000105");
+//    Assertions.assertEquals(expectedDiffList32, actualDiffList32);

Review Comment:
   Is this test no longer valid?



-- 
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