Skip to content

Commit 117abb2

Browse files
mykauldkropachev
authored andcommitted
tests: fix NLB replacement test bootstrap crash due to missing rackdc properties
The _bootstrap_node() method in TestFullNodeReplacementThroughNlb calls ccm_cluster.add() without passing data_center or rack. CCM does not infer these from existing nodes, so the new node's cassandra-rackdc.properties file is left with only template comments. Scylla's GossipingPropertyFileSnitch fails to parse the empty file and crashes on startup with 'locator::bad_property_file_error'. Fix by reading data_center/rack from an existing cluster node and passing them explicitly to ccm_cluster.add(). This test was added in PR #706 with a @skip_scylla_version_lt(2026.1.0) decorator and CI runs Scylla 2025.2, so the bug was never caught.
1 parent 4502520 commit 117abb2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/integration/standard/test_client_routes.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def test_should_survive_full_node_replacement_through_nlb(self):
11781178
ccm_cluster = get_cluster()
11791179

11801180
for node_id in new_node_ids:
1181-
self._bootstrap_node(ccm_cluster, node_id)
1181+
self._bootstrap_node(ccm_cluster, node_id, data_center='dc1')
11821182

11831183
expected_total = len(original_node_ids) + len(new_node_ids)
11841184
self._wait_for_condition(
@@ -1283,7 +1283,7 @@ def _query_succeeds(self, session):
12831283
except Exception:
12841284
return False
12851285

1286-
def _bootstrap_node(self, ccm_cluster, node_id):
1286+
def _bootstrap_node(self, ccm_cluster, node_id, data_center=None, rack=None):
12871287
node_type = type(next(iter(ccm_cluster.nodes.values())))
12881288
ip = "127.0.0.%d" % node_id
12891289
node_instance = node_type(
@@ -1297,7 +1297,12 @@ def _bootstrap_node(self, ccm_cluster, node_id):
12971297
remote_debug_port=0,
12981298
initial_token=None,
12991299
)
1300-
ccm_cluster.add(node_instance, is_seed=False)
1300+
# CCM requires explicit data_center/rack when adding a node so that
1301+
# cassandra-rackdc.properties is written correctly. Without this the
1302+
# snitch fails to parse the empty properties file and the node crashes
1303+
# on startup.
1304+
ccm_cluster.add(node_instance, is_seed=False,
1305+
data_center=data_center, rack=rack)
13011306
node_instance.start(wait_for_binary_proto=True, wait_other_notice=True)
13021307
wait_for_node_socket(node_instance, 120)
13031308
log.info("Node %d bootstrapped successfully", node_id)

0 commit comments

Comments
 (0)