Skip to content

Commit

Permalink
fix(nodetool rebuild): use repair instead of rebuild if no tablets su…
Browse files Browse the repository at this point in the history
…pport

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)
  • Loading branch information
yarongilor committed Oct 28, 2024
1 parent 7a702c7 commit 56d1bbe
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3976,8 +3976,14 @@ def start_and_interrupt_repair_streaming(self):

self.target_node.wait_node_fully_start()

with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
# If tablets in use and rebuild is not supported, running a repair instead.
with self.cluster.cql_connection_patient(self.target_node) as session:
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
self.target_node.run_nodetool(sub_cmd="repair")
else:
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)

def start_and_interrupt_rebuild_streaming(self):
"""
Expand Down Expand Up @@ -4007,8 +4013,14 @@ def start_and_interrupt_rebuild_streaming(self):
)
ParallelObject(objects=[trigger, watcher], timeout=timeout + 60).call_objects()
self.target_node.wait_node_fully_start(timeout=300)
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)
is_rebuild_supported = SkipPerIssues('scylladb/scylladb#17575', params=self.tester.params)
# If tablets in use and rebuild is not supported, running a repair instead.
with self.cluster.cql_connection_patient(self.target_node) as session:
if is_tablets_feature_enabled(session=session) and not is_rebuild_supported:
self.target_node.run_nodetool(sub_cmd="repair")
else:
with adaptive_timeout(Operations.REBUILD, self.target_node, timeout=HOUR_IN_SEC * 48):
self.target_node.run_nodetool("rebuild", long_running=True, retry=0)

def disrupt_decommission_streaming_err(self):
"""
Expand Down

0 comments on commit 56d1bbe

Please sign in to comment.