Ignore drained nodes when rebalancing

When running `rabbitmq-queues rebalance`, drained nodes (nodes in maintenance mode) should not recive QQ leaders nor CMQ masters.
This commit is contained in:
Michal Kuratczyk 2021-04-21 09:17:11 +02:00
parent b5ed4e7ca1
commit 1c13bb00f1
1 changed files with 1 additions and 1 deletions

View File

@ -504,7 +504,7 @@ maybe_migrate(ByNode, MaxQueuesDesired, [N | Nodes]) ->
[{_, Q, false} = Queue | Queues] = All when length(All) > MaxQueuesDesired ->
Name = amqqueue:get_name(Q),
Module = rebalance_module(Q),
Candidates = Module:get_replicas(Q) -- [N],
Candidates = rabbit_maintenance:filter_out_drained_nodes_consistent_read(Module:get_replicas(Q) -- [N]),
case Candidates of
[] ->
{not_migrated, update_not_migrated_queue(N, Queue, Queues, ByNode)};