From 150ae3789e2c07490227786113aba26163cf5a19 Mon Sep 17 00:00:00 2001 From: Yaniv Michael Kaul Date: Sat, 28 Mar 2026 15:26:56 +0300 Subject: [PATCH] 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. --- tests/integration/standard/test_client_routes.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/integration/standard/test_client_routes.py b/tests/integration/standard/test_client_routes.py index a8a3c30f2c..4e328df0c0 100644 --- a/tests/integration/standard/test_client_routes.py +++ b/tests/integration/standard/test_client_routes.py @@ -1178,7 +1178,7 @@ def test_should_survive_full_node_replacement_through_nlb(self): ccm_cluster = get_cluster() for node_id in new_node_ids: - self._bootstrap_node(ccm_cluster, node_id) + self._bootstrap_node(ccm_cluster, node_id, data_center='dc1') expected_total = len(original_node_ids) + len(new_node_ids) self._wait_for_condition( @@ -1283,7 +1283,7 @@ def _query_succeeds(self, session): except Exception: return False - def _bootstrap_node(self, ccm_cluster, node_id): + def _bootstrap_node(self, ccm_cluster, node_id, data_center=None, rack=None): node_type = type(next(iter(ccm_cluster.nodes.values()))) ip = "127.0.0.%d" % node_id node_instance = node_type( @@ -1297,7 +1297,12 @@ def _bootstrap_node(self, ccm_cluster, node_id): remote_debug_port=0, initial_token=None, ) - ccm_cluster.add(node_instance, is_seed=False) + # CCM requires explicit data_center/rack when adding a node so that + # cassandra-rackdc.properties is written correctly. Without this the + # snitch fails to parse the empty properties file and the node crashes + # on startup. + ccm_cluster.add(node_instance, is_seed=False, + data_center=data_center, rack=rack) node_instance.start(wait_for_binary_proto=True, wait_other_notice=True) wait_for_node_socket(node_instance, 120) log.info("Node %d bootstrapped successfully", node_id)