@@ -71,25 +71,27 @@ public void shouldAvoidHintTransferOnDecommission() throws Exception
7171 {
7272 cluster .schemaChange (withKeyspace ("CREATE TABLE %s.decom_no_hints_test (key int PRIMARY KEY, value int)" ));
7373
74- cluster .coordinator (1 ).execute (withKeyspace ("INSERT INTO %s.decom_no_hints_test (key, value) VALUES (?, ?)" ), ALL , 0 , 0 );
75- long hintsBeforeShutdown = countTotalHints (cluster .get (1 ));
74+ int secondNode = 2 ;
75+ cluster .coordinator (secondNode ).execute (withKeyspace ("INSERT INTO %s.decom_no_hints_test (key, value) VALUES (?, ?)" ), ALL , 0 , 0 );
76+ long hintsBeforeShutdown = countTotalHints (cluster .get (secondNode ));
7677 assertThat (hintsBeforeShutdown ).isEqualTo (0 );
77- long hintsDelivered = countHintsDelivered (cluster .get (1 ));
78+ long hintsDelivered = countHintsDelivered (cluster .get (secondNode ));
7879 assertThat (hintsDelivered ).isEqualTo (0 );
7980
8081 // Shutdown node 3 so hints can be written against it.
8182 cluster .get (3 ).shutdown ().get ();
8283
83- cluster .coordinator (1 ).execute (withKeyspace ("INSERT INTO %s.decom_no_hints_test (key, value) VALUES (?, ?)" ), TWO , 0 , 0 );
84- Awaitility .await ().until (() -> countTotalHints (cluster .get (1 )) > 0 );
85- long hintsAfterShutdown = countTotalHints (cluster .get (1 ));
84+ cluster .coordinator (secondNode ).execute (withKeyspace ("INSERT INTO %s.decom_no_hints_test (key, value) VALUES (?, ?)" ), TWO , 0 , 0 );
85+ Awaitility .await ().until (() -> countTotalHints (cluster .get (secondNode )) > 0 );
86+ long hintsAfterShutdown = countTotalHints (cluster .get (secondNode ));
8687 assertThat (hintsAfterShutdown ).isEqualTo (1 );
8788
88- cluster .get (2 ).runOnInstance (() -> setProgressBarrierMinConsistencyLevel (org .apache .cassandra .db .ConsistencyLevel .ONE ));
89+ cluster .get (secondNode ).runOnInstance (() -> setProgressBarrierMinConsistencyLevel (org .apache .cassandra .db .ConsistencyLevel .ONE ));
90+
8991 ClusterUtils .waitForCMSToQuiesce (cluster , cluster .get (1 ), 3 );
90- cluster .get (2 ).nodetoolResult ("decommission" , "--force" ).asserts ().success ();
91- long hintsDeliveredByDecom = countHintsDelivered (cluster .get (2 ));
92- String mode = cluster .get (2 ).callOnInstance (() -> StorageService .instance .getOperationMode ());
92+ cluster .get (secondNode ).nodetoolResult ("decommission" , "--force" ).asserts ().success ();
93+ long hintsDeliveredByDecom = countHintsDelivered (cluster .get (secondNode ));
94+ String mode = cluster .get (secondNode ).callOnInstance (() -> StorageService .instance .getOperationMode ());
9395 assertEquals (StorageService .Mode .DECOMMISSIONED .toString (), mode );
9496 assertThat (hintsDeliveredByDecom ).isEqualTo (0 );
9597 }
0 commit comments