Repository: cassandra-dtest
Updated Branches:
  refs/heads/master a5df23d10 -> b2c1dccea


Updating repair test for CASSANDRA-14763


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/b2c1dcce
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/b2c1dcce
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/b2c1dcce

Branch: refs/heads/master
Commit: b2c1dcceacca1fce02533747367f7571adebc916
Parents: a5df23d
Author: Blake Eggleston <[email protected]>
Authored: Thu Sep 20 08:51:51 2018 -0700
Committer: Blake Eggleston <[email protected]>
Committed: Fri Sep 21 10:03:31 2018 -0700

----------------------------------------------------------------------
 repair_tests/repair_test.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/b2c1dcce/repair_tests/repair_test.py
----------------------------------------------------------------------
diff --git a/repair_tests/repair_test.py b/repair_tests/repair_test.py
index f5bfe28..d4a59a8 100644
--- a/repair_tests/repair_test.py
+++ b/repair_tests/repair_test.py
@@ -1087,6 +1087,35 @@ class TestRepair(BaseRepairTest):
         node2.start(wait_for_binary_proto=True)
         node2.repair()
 
+    def _cancel_open_ir_sessions(self, nodes):
+        cancelled = 0;
+        for node in nodes:
+            stdout = node.nodetool('repair_admin').stdout.strip()
+            if stdout.strip() == 'no sessions':
+                continue
+
+            for line in stdout.split('\n')[1:]:
+                columns = [c.strip() for c in line.split('|')]
+                session = columns[0]
+                coordinator = columns[3]
+                if coordinator == node.address_and_port():
+                    node.nodetool('repair_admin --cancel {}'.format(session))
+                    cancelled += 1
+
+        time.sleep(1)
+
+        # force all of the sstables out of pending repair
+        for node in nodes:
+            node.nodetool('compact')
+
+        for node in nodes:
+            stdout = node.nodetool('repair_admin').stdout.strip()
+            assert stdout.strip() == 'no sessions'
+
+        return cancelled
+
+
+
     def test_dead_coordinator(self):
         """
         @jira_ticket CASSANDRA-11824
@@ -1122,6 +1151,9 @@ class TestRepair(BaseRepairTest):
         node1.start(wait_for_binary_proto=True, wait_other_notice=True)
         logger.debug("running second repair")
         if cluster.version() >= "2.2":
+            # 4.0+ actually requires manual intervention here (CASSANDRA-14763)
+            if cluster.version() >= '4.0':
+                assert self._cancel_open_ir_sessions(cluster.nodelist()) == 1
             node1.repair()
         else:
             node1.nodetool('repair keyspace1 standard1 -inc -par')


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to