bharatviswa504 commented on a change in pull request #2886:
URL: https://github.com/apache/ozone/pull/2886#discussion_r770120232



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
##########
@@ -333,4 +340,78 @@ public void testForceBootstrap() throws Exception {
     // Verify that the newly bootstrapped OM is running
     Assert.assertTrue(newOM.isRunning());
   }
+
+  /**
+   * Decommissioning Tests:
+   * 1. Stop an OM and decommission it from a 3 node cluster
+   * 2. Decommission another OM without stopping it.
+   * 3.
+   */
+  @Test
+  public void testDecommission() throws Exception {
+    setupCluster(3);
+    user = UserGroupInformation.getCurrentUser();
+
+    // Stop the 3rd OM and decommission it
+    String omNodeId3 = cluster.getOzoneManager(2).getOMNodeId();
+    cluster.stopOzoneManager(omNodeId3);
+    decommissionOM(omNodeId3);
+
+    // Decommission an OM and then stop it. Stopping OM before will lead
+    // to no quorum and there will not be a elected leader OM to process the
+    // decommission request.
+    String omNodeId2 = cluster.getOzoneManager(1).getOMNodeId();
+    decommissionOM(omNodeId2);
+    cluster.stopOzoneManager(omNodeId2);
+
+    // Verify that we can read/ write to the cluster with only 1 OM.
+    OzoneVolume volume = objectStore.getVolume(VOLUME_NAME);

Review comment:
       Got it. Now it makes sense why test passes :)




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