Skip to content

Commit

Permalink
fix(update-db-packages): stop only updated nodes
Browse files Browse the repository at this point in the history
When updating multiple nodes db packages, SCT stops all the nodes.
This is wrong and causes tests to fail when providing
`update_db_packages` param.

Fix by removing broken logic and dropping code for nodes stop ordering.

fixes: #8551
(cherry picked from commit c140e7b)
  • Loading branch information
soyacz authored and mergify[bot] committed Sep 29, 2024
1 parent 08bf848 commit 3c7c116
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -4212,26 +4212,10 @@ def start_scylla(node):

start_time = time.time()

if len(node_list) == 1:
# Stop only new nodes
self.run_func_parallel(func=stop_scylla, node_list=node_list) # pylint: disable=no-member
# Then, update packages only on requested node
self.run_func_parallel(func=update_scylla_packages, node_list=node_list) # pylint: disable=no-member
if start_service:
# Start new nodes
self.run_func_parallel(func=start_scylla, node_list=node_list) # pylint: disable=no-member
else:
# First, stop *all* non seed nodes
self.run_func_parallel(func=stop_scylla, node_list=self.non_seed_nodes) # pylint: disable=no-member
# First, stop *all* seed nodes
self.run_func_parallel(func=stop_scylla, node_list=self.seed_nodes) # pylint: disable=no-member
# Then, update packages only on requested nodes
self.run_func_parallel(func=update_scylla_packages, node_list=node_list) # pylint: disable=no-member
if start_service:
# Start all seed nodes
self.run_func_parallel(func=start_scylla, node_list=self.seed_nodes) # pylint: disable=no-member
# Start all non seed nodes
self.run_func_parallel(func=start_scylla, node_list=self.non_seed_nodes) # pylint: disable=no-member
self.run_func_parallel(func=stop_scylla, node_list=node_list) # pylint: disable=no-member
self.run_func_parallel(func=update_scylla_packages, node_list=node_list) # pylint: disable=no-member
if start_service:
self.run_func_parallel(func=start_scylla, node_list=node_list) # pylint: disable=no-member

time_elapsed = time.time() - start_time
self.log.debug('Update DB packages duration -> %s s', int(time_elapsed))
Expand Down

0 comments on commit 3c7c116

Please sign in to comment.