smiklosovic commented on code in PR #1835:
URL: https://github.com/apache/cassandra/pull/1835#discussion_r966164957


##########
test/distributed/org/apache/cassandra/distributed/test/HintedHandoffAddRemoveNodesTest.java:
##########
@@ -46,6 +50,36 @@
  */
 public class HintedHandoffAddRemoveNodesTest extends TestBaseImpl
 {
+    @Test
+    public void shouldAvoidHintTransferOnDecommission() throws Exception
+    {
+        try (Cluster cluster = init(builder().withNodes(3)
+                                             .withConfig(config -> 
config.set("transfer_hints_on_decommission", false).with(GOSSIP))
+                                             .withoutVNodes()
+                                             .start()))
+        {
+            cluster.schemaChange(withKeyspace("CREATE TABLE 
%s.decom_no_hints_test (key int PRIMARY KEY, value int)"));
+
+            cluster.coordinator(1).execute("INSERT INTO " + KEYSPACE + 
".decom_no_hints_test (key, value) VALUES (?, ?)", ALL, 0, 0);
+            long hintsBeforeShutdown = countTotalHints(cluster.get(1));
+            assertThat(hintsBeforeShutdown).isEqualTo(0);
+            long hintsDelivered = countHintsDelivered(cluster.get(1));
+            assertThat(hintsDelivered).isEqualTo(0);
+
+            // Shutdown node 3 so hints can be written against it.
+            cluster.get(3).shutdown().get();
+
+            cluster.coordinator(1).execute("INSERT INTO " + KEYSPACE + 
".decom_no_hints_test (key, value) VALUES (?, ?)", TWO, 0, 0);

Review Comment:
   same



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