smengcl commented on code in PR #3981:
URL: https://github.com/apache/ozone/pull/3981#discussion_r1040298140
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java:
##########
@@ -194,27 +199,51 @@ 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> sstDiffList21 = differ.getSSTDiffList(snap2, snap1);
+ LOG.debug("Got diff list: {}", sstDiffList21);
+
+ // 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> sstDiffList32 = differ.getSSTDiffList(snap3, snap2);
Review Comment:
1. I don't see how we would change the existing checks one dependent on
another into parameterized test here?
2. `testZeroSizeKey` name was originally taken from existing freon test:
https://github.com/apache/ozone/blob/e38607b0cde1591097726b42cb85913b93a39b43/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java#L168-L169
renamed.
--
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]