Skip to content

Commit

Permalink
fix(nemesis): set_target_node should first give up current target
Browse files Browse the repository at this point in the history
in PR #7016 there was a change that drop this part from the code
without it, we can get into case that nemesis which are calling this
function directly, might leave some nodes mark with `running_nemesis`
while no cleaup code can figure it out, and would unmark only the
current target selected.

Fixes: #7220
  • Loading branch information
fruch authored and vponomaryov committed Feb 21, 2024
1 parent 6a89087 commit dbb58dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ def set_target_node(self, dc_idx: Optional[int] = None, rack: Optional[int] = No
if is_seed is DefaultValue - if self.filter_seed is True it act as if is_seed=False,
otherwise it will act as if is_seed is None
"""
# first give up the current target node
self.unset_current_running_nemesis(self.target_node)

with NEMESIS_TARGET_SELECTION_LOCK:
nodes = self._get_target_nodes(is_seed=is_seed, dc_idx=dc_idx, rack=rack)
if not nodes:
Expand Down

0 comments on commit dbb58dc

Please sign in to comment.