Skip to content

Commit 1c13bb0

Browse files
committed
Ignore drained nodes when rebalancing
When running `rabbitmq-queues rebalance`, drained nodes (nodes in maintenance mode) should not recive QQ leaders nor CMQ masters.
1 parent b5ed4e7 commit 1c13bb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/rabbit/src/rabbit_amqqueue.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ maybe_migrate(ByNode, MaxQueuesDesired, [N | Nodes]) ->
504504
[{_, Q, false} = Queue | Queues] = All when length(All) > MaxQueuesDesired ->
505505
Name = amqqueue:get_name(Q),
506506
Module = rebalance_module(Q),
507-
Candidates = Module:get_replicas(Q) -- [N],
507+
Candidates = rabbit_maintenance:filter_out_drained_nodes_consistent_read(Module:get_replicas(Q) -- [N]),
508508
case Candidates of
509509
[] ->
510510
{not_migrated, update_not_migrated_queue(N, Queue, Queues, ByNode)};

0 commit comments

Comments
 (0)