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

Commit 4d085df

Browse files
Merge pull request #193 from rabbitmq/rabbitmq-server-1213
Promote slaves only for actual members when forgetting cluster nodes
2 parents 9f8b33b + 0a5d76d commit 4d085df

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
@@ -853,8 +853,10 @@ forget_node_for_queue(DeadNode, [H|T], Q) ->
853853
node_permits_offline_promotion(Node) ->
854854
case node() of
855855
Node -> not rabbit:is_running(); %% [1]
856-
_ -> Running = rabbit_mnesia:cluster_nodes(running),
857-
not lists:member(Node, Running) %% [2]
856+
_ -> All = rabbit_mnesia:cluster_nodes(all),
857+
Running = rabbit_mnesia:cluster_nodes(running),
858+
lists:member(Node, All) andalso
859+
not lists:member(Node, Running) %% [2]
858860
end.
859861
%% [1] In this case if we are a real running node (i.e. rabbitmqctl
860862
%% has RPCed into us) then we cannot allow promotion. If on the other

0 commit comments

Comments
 (0)