Skip to content

Commit 3635f1a

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 8dcdcc9 commit 3635f1a

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
@@ -4147,8 +4147,15 @@ def start_and_interrupt_repair_streaming(self):
41474147

41484148
self.target_node.wait_node_fully_start()
41494149

4150-
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4151-
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
4150+
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
4151+
# If tablets in use and rebuild is not supported, running a DC repair instead.
4152+
with self.cluster.cql_connection_patient(self.target_node) as session:
4153+
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
4154+
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx and n.db_up()]:
4155+
node.run_nodetool(sub_cmd="repair", long_running=True, retry=0)
4156+
else:
4157+
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4158+
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
41524159

41534160
def start_and_interrupt_rebuild_streaming(self):
41544161
"""
@@ -4178,8 +4185,15 @@ def start_and_interrupt_rebuild_streaming(self):
41784185
)
41794186
ParallelObject(objects=[trigger, watcher], timeout=timeout + 60).call_objects()
41804187
self.target_node.wait_node_fully_start(timeout=300)
4181-
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4182-
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
4188+
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
4189+
# If tablets in use and rebuild is not supported, running a DC repair instead.
4190+
with self.cluster.cql_connection_patient(self.target_node) as session:
4191+
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
4192+
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx and n.db_up()]:
4193+
node.run_nodetool(sub_cmd="repair", long_running=True, retry=0)
4194+
else:
4195+
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
4196+
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
41834197

41844198
def disrupt_decommission_streaming_err(self):
41854199
"""

0 commit comments

Comments
 (0)