Skip to content

Commit f24debe

Browse files
author
yarongilor
committed
fix(nodetool rebuild): use repair instead of rebuild if no tablets support
if no tables support for nodetool rebuild, test should use an alternative action of repair. it should then disable load-balancing and repair all nodes in this datacenter. refs: scylladb/scylladb#17575 refs: scylladb/scylladb#20084 (comment)
1 parent 7a702c7 commit f24debe

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

sdcm/nemesis.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3976,8 +3976,15 @@ def start_and_interrupt_repair_streaming(self):
39763976

39773977
self.target_node.wait_node_fully_start()
39783978

3979-
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
3980-
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
3979+
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
3980+
# If tablets in use and rebuild is not supported, running a DC repair instead.
3981+
with self.cluster.cql_connection_patient(self.target_node) as session:
3982+
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
3983+
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx]:
3984+
node.run_nodetool(sub_cmd="repair")
3985+
else:
3986+
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
3987+
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
39813988

39823989
def start_and_interrupt_rebuild_streaming(self):
39833990
"""
@@ -4007,8 +4014,15 @@ def start_and_interrupt_rebuild_streaming(self):
40074014
)
40084015
ParallelObject(objects=[trigger, watcher], timeout=timeout + 60).call_objects()
40094016
self.target_node.wait_node_fully_start(timeout=300)
4010-
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4011-
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
4017+
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
4018+
# If tablets in use and rebuild is not supported, running a DC repair instead.
4019+
with self.cluster.cql_connection_patient(self.target_node) as session:
4020+
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
4021+
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx]:
4022+
node.run_nodetool(sub_cmd="repair")
4023+
else:
4024+
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4025+
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
40124026

40134027
def disrupt_decommission_streaming_err(self):
40144028
"""

0 commit comments

Comments
 (0)