Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nodetool rebuild): use repair instead of rebuild if no tablets support #9073

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3976,8 +3976,15 @@ 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 DC 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:
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx]:
node.run_nodetool(sub_cmd="repair")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend doing long_running=True, retry=0

also maybe to consider hard timeout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I'm not sure you have guarantee all the nodes in this DC are up and running...

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 +4014,15 @@ 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 DC 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:
for node in [n for n in self.cluster.nodes if n.dc_idx == self.target_node.dc_idx]:
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