From 10d3c59fad336bf7f5081f6b0e7a5e2d54c21575 Mon Sep 17 00:00:00 2001 From: Israel Fruchter Date: Wed, 21 Feb 2024 10:25:26 +0200 Subject: [PATCH] fix(nemesis): `set_target_node` should first give up current target 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 (cherry picked from commit dbb58dc8b353228ec421f0e82ec2618d111e4162) --- sdcm/nemesis.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdcm/nemesis.py b/sdcm/nemesis.py index bba4c2c4be..0087bd8f33 100644 --- a/sdcm/nemesis.py +++ b/sdcm/nemesis.py @@ -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: