Skip to content
Closed
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
38 changes: 15 additions & 23 deletions bootstrap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ def fixture_add_additional_log_patterns(self, fixture_dtest_setup):
r'Streaming error occurred'
)

def _start_cluster_sequentially(self, cluster):
"""Start all nodes one at a time, waiting for each to be ready.

Sequential startup is required for all Cassandra versions:
<= 5.0: simultaneous start causes token assignment conflicts (CASSANDRA-19097)
>= 5.1: seed must be reachable before non-seeds begin CMS discovery (CASSANDRA-21185)
"""
for node in cluster.nodelist():
node.start(wait_for_binary_proto=True)
cluster.start()

def _base_bootstrap_test(self, bootstrap=None, bootstrap_from_version=None,
enable_ssl=None):
def default_bootstrap(cluster, token):
Expand Down Expand Up @@ -251,12 +262,7 @@ 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()
self._start_cluster_sequentially(cluster)

node1 = cluster.nodes['node1']
node1.stress(['write', 'n=10K', 'no-warmup', '-rate', 'threads=8', '-schema', 'replication(factor=2)'])
Expand Down Expand Up @@ -524,11 +530,7 @@ def test_manual_bootstrap(self):
cluster = self.cluster
cluster.set_environment_variable('CASSANDRA_TOKEN_PREGENERATION_DISABLED', 'True')
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()
self._start_cluster_sequentially(cluster)
(node1, node2) = cluster.nodelist()

node1.stress(['write', 'n=1K', 'no-warmup', '-schema', 'replication(factor=2)',
Expand Down Expand Up @@ -630,12 +632,7 @@ 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()
self._start_cluster_sequentially(cluster)

stress_table = 'keyspace1.standard1'

Expand Down Expand Up @@ -671,12 +668,7 @@ 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()
self._start_cluster_sequentially(cluster)

stress_table = 'keyspace1.standard1'

Expand Down