diff options
author | dcorbacho <dparracorbacho@piotal.io> | 2021-03-17 23:26:29 +0100 |
---|---|---|
committer | dcorbacho <dparracorbacho@piotal.io> | 2021-03-17 23:26:29 +0100 |
commit | 75e37ce1db94caa9cc42cfbb5d654a0b124c97b8 (patch) | |
tree | c165290e545234128cf0a8138f60fe004f676cc8 | |
parent | a57b8e354d3860fb8de51bb1f4d65a553a10cc1a (diff) | |
download | rabbitmq-server-git-unsupported-stream-rebalance.tar.gz |
Filter out stream queues from rebalance commandunsupported-stream-rebalance
It's not yet supported by streams, so avoid them altogether to avoid crashes
-rw-r--r-- | deps/rabbit/src/rabbit_amqqueue.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/deps/rabbit/src/rabbit_amqqueue.erl b/deps/rabbit/src/rabbit_amqqueue.erl index 80937b38ea..f7315f12eb 100644 --- a/deps/rabbit/src/rabbit_amqqueue.erl +++ b/deps/rabbit/src/rabbit_amqqueue.erl @@ -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). |