Skip to content

Commit

Permalink
fix(nemesis): target node only from data nodes pool
Browse files Browse the repository at this point in the history
For current moment to support previous behavior of
nemisis, set target node only from data nodes
Also change BaseScyllaCluster.decommission to avoid
operations on zero nodes
  • Loading branch information
aleksbykov authored and fruch committed Nov 3, 2024
1 parent f3ef6e4 commit ecb1126
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 32 deletions.
13 changes: 8 additions & 5 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -4492,7 +4492,7 @@ def cfstat_reached_threshold(self, key, threshold, keyspaces=None):
keyspaces = self.get_test_keyspaces()

self.log.debug("Waiting for threshold: %s" % (threshold))
node = self.nodes[0]
node = self.data_nodes[0]
node_space = 0
# Calculate space on the disk of all test keyspaces on the one node.
# It's decided to check the threshold on one node only
Expand Down Expand Up @@ -5042,13 +5042,16 @@ def get_node_ip_list(verification_node):
self.test_config.tester_obj().monitors.reconfigure_scylla_monitoring()

def decommission(self, node: BaseNode, timeout: int | float = None) -> DataCenterTopologyRfControl | None:
with node.parent_cluster.cql_connection_patient(node) as session:
if tablets_enabled := is_tablets_feature_enabled(session):
dc_topology_rf_change = DataCenterTopologyRfControl(target_node=node)
dc_topology_rf_change.decrease_keyspaces_rf()
if not node._is_zero_token_node:
with node.parent_cluster.cql_connection_patient(node) as session:
if tablets_enabled := is_tablets_feature_enabled(session):
dc_topology_rf_change = DataCenterTopologyRfControl(target_node=node)
dc_topology_rf_change.decrease_keyspaces_rf()
with adaptive_timeout(operation=Operations.DECOMMISSION, node=node):
node.run_nodetool("decommission", timeout=timeout, long_running=True, retry=0)
self.verify_decommission(node)
if node._is_zero_token_node:
return None
return dc_topology_rf_change if tablets_enabled else None

@property
Expand Down
Loading

0 comments on commit ecb1126

Please sign in to comment.