-
Notifications
You must be signed in to change notification settings - Fork 95
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
feature(raft): Rolling restart raft topology coordinator node #9102
base: master
Are you sure you want to change the base?
feature(raft): Rolling restart raft topology coordinator node #9102
Conversation
a231f16
to
ee78519
Compare
sdcm/nemesis.py
Outdated
@@ -5151,6 +5151,35 @@ def disrupt_disable_binary_gossip_execute_major_compaction(self): | |||
self.target_node.restart_scylla_server() | |||
raise | |||
|
|||
def disrupt_rolling_restart_topology_coordinator_node(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name rolling restart doesn't related to what going on with this nemesis
it's multiple restarts of the same node.
rolling means, all of the cluster is being restarted (one by one, hence where the rolling comes from)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aleksbykov please update the PR headline and the commit headline, to match the name change
sdcm/utils/raft/common.py
Outdated
@@ -44,6 +50,27 @@ def validate_raft_on_nodes(nodes: list[BaseNode]) -> None: | |||
LOGGER.debug("Raft is ready!") | |||
|
|||
|
|||
def get_topology_coordinator_node(cluster: BaseScyllaCluster) -> BaseNode: | |||
active_nodes = cluster.get_nodes_up_and_normal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this function should be guarded with self.target_node.raft.is_consistent_topology_changes_enabled
?
to make sure it's not getting called when raft topology is disabled ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name of this nemesis should have rolling
in it.
ee78519
to
06e5079
Compare
Ins't it a Scylla issue? |
06e5079
to
46fc2e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more small issues, otherwise LGTM.
if we backport it, it will shuffle all nemesis lists on backported branches. Do we want that backported? cc @roydahan
sdcm/nemesis.py
Outdated
coordinator_node.start_scylla() | ||
assert coordinator_node != new_coordinator_node, \ | ||
f"New coordinator node was not elected while old one {coordinator_node.name} was stopped" | ||
self.unset_current_running_nemesis(coordinator_node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's unset before assert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. fixed
46fc2e9
to
d7dd6d8
Compare
i think we can live with it on master only |
Staging jobs were passed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing and good to go for me.
sdcm/nemesis.py
Outdated
self.log.debug("Wait new topology coordinator election timeout: %s", election_wait_timeout) | ||
self.unset_current_running_nemesis(self.target_node) | ||
for _ in range(num_of_restarts): | ||
self.target_node = coordinator_node = get_topology_coordinator_node(cluster=self.cluster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should set target node after verifying it's not running nemesis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have machinery for selecting target_node, all selection of target nodes should work in similar fashion
see the logic of run_nemesis
doing so in multiple setup, is prone to errors and can lead to selection of the same target nodes from multiple nemesis threads, every selection should go via the same lock we introduced for that purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with run nemesis
it's going to fail the test when coordinator node is one that currently runs nemesis due to assert free_nodes, f"couldn't find nodes for running:
{nemesis_label}, are all nodes running nemesis ?"
When current topology coordinator is not available, new round of election of new coordinator should be started and new raft topology coordinator node will be elected. Added new function to search current coordinator node Added new nemesis to Rolling restart of elected coordinator node
d7dd6d8
to
383b743
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
new_coordinator_node = get_topology_coordinator_node(cluster=self.cluster) | ||
self.log.debug("New coordinator node: %s, %s", new_coordinator_node, new_coordinator_node.name) | ||
coordinator_node.start_scylla() | ||
self.unset_current_running_nemesis(coordinator_node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there was a failure you won't reach this, and would let go of that node, no more nemesis would run on it
we should use context manager (similar to run_nemesis), or try/finally clause here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but won't nemesis mashinery unset running nemesis upon finishing? (that's why need to re-set target node each loop)
When current topology coordinator is not available, new round
of election of new coordinator should be started and new
raft topology coordinator node will be elected.
Added new function to search current coordinator node
Added new nemesis to Rolling restart of elected coordinator node
Testing
PR pre-checks (self review)
backport
labelsReminders
sdcm/sct_config.py
)unit-test/
folder)