Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 0a5d76d

Browse files
committed
Promote slaves only for actual cluster members when forgetting cluster nodes
Ensures that newly forgotten nodes are not selected for promotion, otherwise restarted slaves might not be able to bring up the queues. rabbitmq-server#1213 [#145084865]
1 parent 6ee312c commit 0a5d76d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rabbit_amqqueue.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,10 @@ forget_node_for_queue(DeadNode, [H|T], Q) ->
866866
node_permits_offline_promotion(Node) ->
867867
case node() of
868868
Node -> not rabbit:is_running(); %% [1]
869-
_ -> Running = rabbit_mnesia:cluster_nodes(running),
870-
not lists:member(Node, Running) %% [2]
869+
_ -> All = rabbit_mnesia:cluster_nodes(all),
870+
Running = rabbit_mnesia:cluster_nodes(running),
871+
lists:member(Node, All) andalso
872+
not lists:member(Node, Running) %% [2]
871873
end.
872874
%% [1] In this case if we are a real running node (i.e. rabbitmqctl
873875
%% has RPCed into us) then we cannot allow promotion. If on the other

0 commit comments

Comments
 (0)