Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions bootstrap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,19 @@ def test_read_from_bootstrapped_node(self):
cluster = self.cluster
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
cluster.populate(3)
if cluster.version() <= '5.0':
# Nodes need to be started one by one pre-TCM, not all at once. See CASSANDRA-19097
cluster.nodelist()[0].start(wait_for_binary_proto=True)
cluster.nodelist()[1].start(wait_for_binary_proto=True)
cluster.nodelist()[2].start(wait_for_binary_proto=True)
cluster.start()

node1 = cluster.nodes['node1']
node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8', '-schema', 'replication(factor=2)'])

session = self.patient_cql_connection(node1)
stress_table = 'keyspace1.standard1'
query = SimpleStatement("SELECT * FROM %s" % (stress_table), consistency_level=ConsistencyLevel.ALL)
query = SimpleStatement("SELECT * FROM %s" % (stress_table))
original_rows = list(session.execute(query))

node4 = new_node(cluster)
Expand Down Expand Up @@ -518,7 +523,12 @@ def test_manual_bootstrap(self):
"""
cluster = self.cluster
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
cluster.populate(2).start()
cluster.populate(2)
if cluster.version() <= '5.0':
# Nodes need to be started one by one pre-TCM, not all at once. See CASSANDRA-19097
cluster.nodelist()[0].start(wait_for_binary_proto=True)
cluster.nodelist()[1].start(wait_for_binary_proto=True)
cluster.start()
(node1, node2) = cluster.nodelist()

node1.stress(['write', 'n=1K', 'no-warmup', '-schema', 'replication(factor=2)',
Expand All @@ -527,7 +537,7 @@ def test_manual_bootstrap(self):
session = self.patient_exclusive_cql_connection(node2)
stress_table = 'keyspace1.standard1'

query = SimpleStatement("SELECT * FROM %s" % stress_table, consistency_level=ConsistencyLevel.ALL)
query = SimpleStatement("SELECT * FROM %s" % stress_table)
original_rows = list(session.execute(query))

# Add a new node
Expand Down Expand Up @@ -620,6 +630,11 @@ def _wiped_node_cannot_join_test(self, gently):
cluster = self.cluster
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
cluster.populate(3)
if cluster.version() <= '5.0':
# Nodes need to be started one by one pre-TCM, not all at once. See CASSANDRA-19097
cluster.nodelist()[0].start(wait_for_binary_proto=True)
cluster.nodelist()[1].start(wait_for_binary_proto=True)
cluster.nodelist()[2].start(wait_for_binary_proto=True)
cluster.start()

stress_table = 'keyspace1.standard1'
Expand All @@ -629,7 +644,7 @@ def _wiped_node_cannot_join_test(self, gently):
node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8'])

session = self.patient_cql_connection(node1)
query = SimpleStatement("SELECT * FROM {}".format(stress_table), consistency_level=ConsistencyLevel.ALL)
query = SimpleStatement("SELECT * FROM {}".format(stress_table))
original_rows = list(session.execute(query))

# Add a new node, bootstrap=True ensures that it is not a seed
Expand All @@ -655,6 +670,11 @@ def test_decommissioned_wiped_node_can_join(self):
cluster = self.cluster
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
cluster.populate(3)
if cluster.version() <= '5.0':
# Nodes need to be started one by one pre-TCM, not all at once. See CASSANDRA-19097
cluster.nodelist()[0].start(wait_for_binary_proto=True)
cluster.nodelist()[1].start(wait_for_binary_proto=True)
cluster.nodelist()[2].start(wait_for_binary_proto=True)
cluster.start()

stress_table = 'keyspace1.standard1'
Expand All @@ -664,7 +684,7 @@ def test_decommissioned_wiped_node_can_join(self):
node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8'])

session = self.patient_cql_connection(node1)
query = SimpleStatement("SELECT * FROM {}".format(stress_table), consistency_level=ConsistencyLevel.ALL)
query = SimpleStatement("SELECT * FROM {}".format(stress_table))
original_rows = list(session.execute(query))

# Add a new node, bootstrap=True ensures that it is not a seed
Expand Down