Skip to content

Commit e7a386c

Browse files
fix case where all nodes are full with shards
1 parent a03830f commit e7a386c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_scenario/maint_notifications_helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,22 @@ def find_target_node_and_empty_node(
164164
shards_section_started = False
165165

166166
# Find empty node (node with no shards from ANY database)
167-
empty_nodes = all_nodes - nodes_with_any_shards
167+
nodes_with_no_shards_target_bdb = all_nodes - nodes_with_target_db_shards
168168

169169
logging.debug(f"All nodes: {all_nodes}")
170170
logging.debug(f"Nodes with shards from any database: {nodes_with_any_shards}")
171171
logging.debug(f"Nodes with target database shards: {nodes_with_target_db_shards}")
172172
logging.debug(f"Master nodes (target database only): {master_nodes}")
173-
logging.debug(f"Empty nodes: {empty_nodes}")
173+
logging.debug(f"Nodes with no shards from target database: {nodes_with_no_shards_target_bdb}")
174174

175-
if not empty_nodes:
176-
raise ValueError("No empty nodes (nodes without shards) found")
175+
if not nodes_with_no_shards_target_bdb:
176+
raise ValueError("All nodes have shards from target database")
177177

178178
if not master_nodes:
179-
raise ValueError("No nodes with master shards found")
179+
raise ValueError("No nodes with master shards from target database found")
180180

181181
# Return the first available empty node and master node (numeric part only)
182-
empty_node = next(iter(empty_nodes)).split(":")[1] # node:1 -> 1
182+
empty_node = next(iter(nodes_with_no_shards_target_bdb)).split(":")[1] # node:1 -> 1
183183
target_node = next(iter(master_nodes)).split(":")[1] # node:2 -> 2
184184

185185
return target_node, empty_node

0 commit comments

Comments
 (0)