Merge pull request #2902 from rabbitmq/unsupported-stream-rebalance

Filter out stream queues from rebalance command
This commit is contained in:
Michael Klishin 2021-03-19 22:00:09 +03:00 committed by GitHub
commit 5a6c288395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -458,12 +458,11 @@ maybe_rebalance(false, _Type, _VhostSpec, _QueueSpec) ->
rabbit_log:warning("Queue rebalance operation is in progress, please wait."),
{error, rebalance_in_progress}.
filter_per_type(all, _) ->
true;
%% Stream queues don't yet support rebalance
filter_per_type(all, Q) ->
?amqqueue_is_quorum(Q) or ?amqqueue_is_classic(Q);
filter_per_type(quorum, Q) ->
?amqqueue_is_quorum(Q);
filter_per_type(stream, Q) ->
?amqqueue_is_stream(Q);
filter_per_type(classic, Q) ->
?amqqueue_is_classic(Q).
@ -554,7 +553,7 @@ group_by_node(Queues) ->
Module = rebalance_module(Q),
Length = Module:queue_length(Q),
maps:update_with(amqqueue:qnode(Q),
fun(L) -> [{Length, Q, false} | L] end,
fun(L) -> [{Length, Q, false} | L] end,
[{Length, Q, false}], Acc)
end, #{}, Queues),
maps:map(fun(_K, V) -> lists:keysort(1, V) end, ByNode).