From dbad2f788b29eea2996910c162073d267377b10d Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 13 Dec 2016 15:55:40 +0000 Subject: [PATCH] Fix tests where system_distributed/system_traces default RF stopped decommission --- bootstrap_test.py | 6 ++++++ pushed_notifications_test.py | 5 +++++ topology_test.py | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/bootstrap_test.py b/bootstrap_test.py index dccb2acdcf..243d366d85 100644 --- a/bootstrap_test.py +++ b/bootstrap_test.py @@ -544,10 +544,16 @@ def decommissioned_wiped_node_can_gossip_to_single_seed_test(self): cluster.populate(1) cluster.start(wait_for_binary_proto=True) + node1 = cluster.nodelist()[0] # Add a new node, bootstrap=True ensures that it is not a seed node2 = new_node(cluster, bootstrap=True) node2.start(wait_for_binary_proto=True, wait_other_notice=True) + session = self.patient_cql_connection(node1) + # reduce system_distributed RF to 2 so we don't require forceful decommission + session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};") + session.execute("ALTER KEYSPACE system_traces WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};") + # Decommision the new node and kill it debug("Decommissioning & stopping node2") node2.decommission() diff --git a/pushed_notifications_test.py b/pushed_notifications_test.py index 9c31d51b6f..d55d77b653 100644 --- a/pushed_notifications_test.py +++ b/pushed_notifications_test.py @@ -240,6 +240,11 @@ def add_and_remove_node_test(self): waiter.wait_for_notifications(timeout=30, num_notifications=2) waiter.clear_notifications() + session = self.patient_cql_connection(node1) + # reduce system_distributed RF to 2 so we don't require forceful decommission + session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};") + session.execute("ALTER KEYSPACE system_traces WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'1'};") + debug("Adding second node...") node2 = Node('node2', self.cluster, True, ('127.0.0.2', 9160), ('127.0.0.2', 7000), '7200', '0', None, ('127.0.0.2', 9042)) self.cluster.add(node2, False) diff --git a/topology_test.py b/topology_test.py index b68f6411c1..edfd31f1ee 100644 --- a/topology_test.py +++ b/topology_test.py @@ -44,6 +44,10 @@ def simple_decommission_test(self): cluster.start(wait_for_binary_proto=True, jvm_args=["-Dcassandra.size_recorder_interval=1"]) node1, node2, node3 = cluster.nodelist() + session = self.patient_cql_connection(node1) + # reduce system_distributed RF to 2 so we don't require forceful decommission + session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'2'};") + # write some data node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8']) @@ -108,6 +112,8 @@ def resumable_decommission_test(self): node1, node2, node3 = cluster.nodelist() session = self.patient_cql_connection(node2) + # reduce system_distributed RF to 2 so we don't require forceful decommission + session.execute("ALTER KEYSPACE system_distributed WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':'2'};") create_ks(session, 'ks', 2) create_cf(session, 'cf', columns={'c1': 'text', 'c2': 'text'}) insert_c1c2(session, n=10000, consistency=ConsistencyLevel.ALL)