nvharikrishna commented on code in PR #4920:
URL: https://github.com/apache/cassandra/pull/4920#discussion_r3588067887


##########
test/distributed/org/apache/cassandra/distributed/test/ring/DecommissionTest.java:
##########
@@ -84,6 +88,42 @@ public void testResumableDecom() throws IOException
         }
     }
 
+    @Test
+    public void testOperationModeOnDecomResume() throws Exception
+    {
+        // Node 2's first decomission attempt fails mid-stream (injected by 
BB), leaving it in
+        // DECOMISSION_FAILED. On resume, operationMode() must transition back 
to LEAVING before
+        // MID_LEAVE is committed. We pause the CMS just before that commit to 
assert the mode
+        // in the window where streaming has finished but the epoch has not 
yet advanced.
+        try (Cluster cluster = builder().withNodes(3)
+                                        .withConfig(config -> 
config.with(NETWORK, GOSSIP))
+                                        .withInstanceInitializer(BB::install)
+                                        .start())
+        {
+            populate(cluster, 0, 100, 1, 2, ConsistencyLevel.QUORUM);
+
+            IInvokableInstance cmsNode = cluster.get(1);
+            IInvokableInstance leavingNode = cluster.get(2);
+
+            leavingNode.nodetoolResult("decommission", 
"--force").asserts().failure();

Review Comment:
   Ideally running `nodetool decommission` should be sufficient, right? 
`--force` flag required 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: [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