You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2023/01/16 07:01:17 UTC

[GitHub] [ozone] jyotirmoy-gh opened a new pull request, #4178: HDDS-7779. [snapshot] Add unit-testcases for snapshot restore

jyotirmoy-gh opened a new pull request, #4178:
URL: https://github.com/apache/ozone/pull/4178

   ## What changes were proposed in this pull request?
   
   Add UTs for SnapshotDiff - `TestOmSnapshot`
   
   ```
   - testSnapDiffNoSnapshot
   - testSnapDiffNonExistentUrl
   - testSnapDiffMissingMandatoryParams
   ```
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7704
   
   ## How was this patch tested?
   
   Testcase file - `hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java`
   ```
   mvn -Dtest=TestOmSnapshot#testSnapDiff* test
   [INFO] -------------------------------------------------------
   [INFO]  T E S T S
   [INFO] -------------------------------------------------------
   [INFO] Running org.apache.hadoop.ozone.om.TestOmSnapshot
   [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 168.426 s - in org.apache.hadoop.ozone.om.TestOmSnapshot
   [INFO]
   [INFO] Results:
   [INFO]
   [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
   [INFO]
   ```
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sadanand48 commented on a diff in pull request #4178: HDDS-7779. [snapshot] Add unit-testcases for snapshot restore

Posted by GitBox <gi...@apache.org>.
sadanand48 commented on code in PR #4178:
URL: https://github.com/apache/ozone/pull/4178#discussion_r1072078208


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -463,6 +464,95 @@ public void testSnapDiff() throws Exception {
 
   }
 
+  @Test
+  public void testSnapDiffNoSnapshot() throws Exception {
+    String volume = "vol-" + RandomStringUtils.randomNumeric(5);
+    String bucket = "buck-" + RandomStringUtils.randomNumeric(5);
+    store.createVolume(volume);
+    OzoneVolume volume1 = store.getVolume(volume);
+    volume1.createBucket(bucket);
+    OzoneBucket bucket1 = volume1.getBucket(bucket);
+    // Create Key1 and take snapshot
+    String key1 = "key-1-";
+    createFileKey(bucket1, key1);
+    String snap1 = "snap" + RandomStringUtils.randomNumeric(5);
+    createSnapshot(volume, bucket, snap1);
+    String snap2 = "snap" + RandomStringUtils.randomNumeric(5);
+    // Destination snapshot is invalid
+    LambdaTestUtils.intercept(OMException.class,
+            "KEY_NOT_FOUND",

Review Comment:
   If snapshot doesn't exist then it needs to show Snapshot not found and same for bucket I guess. Maybe we can file a jira to improve exception handling here?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on pull request #4178: HDDS-7779. [snapshot] Add unit-testcases for snapshot restore

Posted by GitBox <gi...@apache.org>.
jyotirmoy-gh commented on PR #4178:
URL: https://github.com/apache/ozone/pull/4178#issuecomment-1383591647

   @smengcl @sadanand48 @nilotpalnandi - Please review


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sadanand48 merged pull request #4178: HDDS-7779. [snapshot] Add unit-testcases for Ozone SnapshotDiff

Posted by "sadanand48 (via GitHub)" <gi...@apache.org>.
sadanand48 merged PR #4178:
URL: https://github.com/apache/ozone/pull/4178


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #4178: HDDS-7779. [snapshot] Add unit-testcases for Ozone SnapshotDiff

Posted by GitBox <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #4178:
URL: https://github.com/apache/ozone/pull/4178#discussion_r1073094270


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -463,6 +464,95 @@ public void testSnapDiff() throws Exception {
 
   }
 
+  @Test
+  public void testSnapDiffNoSnapshot() throws Exception {
+    String volume = "vol-" + RandomStringUtils.randomNumeric(5);
+    String bucket = "buck-" + RandomStringUtils.randomNumeric(5);
+    store.createVolume(volume);
+    OzoneVolume volume1 = store.getVolume(volume);
+    volume1.createBucket(bucket);
+    OzoneBucket bucket1 = volume1.getBucket(bucket);
+    // Create Key1 and take snapshot
+    String key1 = "key-1-";
+    createFileKey(bucket1, key1);
+    String snap1 = "snap" + RandomStringUtils.randomNumeric(5);
+    createSnapshot(volume, bucket, snap1);
+    String snap2 = "snap" + RandomStringUtils.randomNumeric(5);
+    // Destination snapshot is invalid
+    LambdaTestUtils.intercept(OMException.class,
+            "KEY_NOT_FOUND",

Review Comment:
   I have raised a JIRA for tracking the better exception handling - https://issues.apache.org/jira/browse/HDDS-7794.
   Probably if we are planning to improve the exception handling then we can update the exception conditions here.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sadanand48 commented on a diff in pull request #4178: HDDS-7779. [snapshot] Add unit-testcases for Ozone SnapshotDiff

Posted by "sadanand48 (via GitHub)" <gi...@apache.org>.
sadanand48 commented on code in PR #4178:
URL: https://github.com/apache/ozone/pull/4178#discussion_r1083674314


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -463,6 +464,95 @@ public void testSnapDiff() throws Exception {
 
   }
 
+  @Test
+  public void testSnapDiffNoSnapshot() throws Exception {
+    String volume = "vol-" + RandomStringUtils.randomNumeric(5);
+    String bucket = "buck-" + RandomStringUtils.randomNumeric(5);
+    store.createVolume(volume);
+    OzoneVolume volume1 = store.getVolume(volume);
+    volume1.createBucket(bucket);
+    OzoneBucket bucket1 = volume1.getBucket(bucket);
+    // Create Key1 and take snapshot
+    String key1 = "key-1-";
+    createFileKey(bucket1, key1);
+    String snap1 = "snap" + RandomStringUtils.randomNumeric(5);
+    createSnapshot(volume, bucket, snap1);
+    String snap2 = "snap" + RandomStringUtils.randomNumeric(5);
+    // Destination snapshot is invalid
+    LambdaTestUtils.intercept(OMException.class,
+            "KEY_NOT_FOUND",

Review Comment:
   Sure, we can correct it from the above jira created.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org