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 2022/01/18 04:37:48 UTC

[GitHub] [ozone] kerneltime commented on a change in pull request #2989: HDDS-6109 Preserve the underlying exception raised in client lib.

kerneltime commented on a change in pull request #2989:
URL: https://github.com/apache/ozone/pull/2989#discussion_r786409843



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java
##########
@@ -677,4 +682,133 @@ public void testWriteStateMachineDataIdempotencyWithClosedContainer()
 
     r2.run();
   }
+
+  @Test
+  public void testContainerStateMachineSingleFailureRetry()
+      throws Exception {
+    OzoneOutputStream key =
+        objectStore.getVolume(volumeName).getBucket(bucketName)
+            .createKey("ratis1", 1024, ReplicationType.RATIS,
+                ReplicationFactor.THREE, new HashMap<>());
+
+    key.write("ratis".getBytes(UTF_8));
+    key.flush();
+    key.write("ratis".getBytes(UTF_8));
+    key.write("ratis".getBytes(UTF_8));
+
+    KeyOutputStream groupOutputStream = (KeyOutputStream) key.
+        getOutputStream();
+    List<OmKeyLocationInfo> locationInfoList =
+        groupOutputStream.getLocationInfoList();
+    Assert.assertEquals(1, locationInfoList.size());
+
+    OmKeyLocationInfo omKeyLocationInfo = locationInfoList.get(0);
+
+    Set<HddsDatanodeService> datanodeSet =
+        TestHelper.getDatanodeServices(cluster,
+            omKeyLocationInfo.getPipeline());
+
+    UUID leader = omKeyLocationInfo.getPipeline().getLeaderId();
+    for (HddsDatanodeService dn : datanodeSet) {
+      UUID dnUuid = dn.getDatanodeDetails().getUuid();
+      if (!dnUuid.equals(leader)) {
+        ContainerData containerData =
+            dn.getDatanodeStateMachine()
+                .getContainer().getContainerSet()
+                .getContainer(omKeyLocationInfo.getContainerID())
+                .getContainerData();
+        Assert.assertTrue(containerData instanceof KeyValueContainerData);
+        KeyValueContainerData keyValueContainerData =
+            (KeyValueContainerData) containerData;
+        FileUtil.fullyDelete(new File(keyValueContainerData.getChunksPath()));
+        break;
+      }
+    }
+    try {
+      key.close();
+    } catch (Exception ioe) {
+      // Should not fail..
+      Assert.fail("Exception " + ioe.getMessage());
+    }
+    validateData("ratis1", 2, "ratisratisratis");
+  }
+
+  @Test
+  public void testContainerStateMachineDualFailureRetry()

Review comment:
       Will do.
   The expected is 2 in this specific targeted case. It is possible to have more than 2 in a real production failure sequence but in a controlled test environment it would be 2.




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