summaryrefslogtreecommitdiff
path: root/src/rabbit_mirror_queue_misc.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-09-02 15:40:57 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-09-02 15:40:57 +0100
commit14365564a65790d65bbdd5b570b06111d9022548 (patch)
tree415946f1b80a77bc6d6e10df2cefca37faed85ed /src/rabbit_mirror_queue_misc.erl
parent13846f921e79ed9924a8a56da74f5cfda88ddb0d (diff)
downloadrabbitmq-server-14365564a65790d65bbdd5b570b06111d9022548.tar.gz
Take GM's view of the live members each time we have a death message; don't assume the master will always be able to write updates to Mnesia.
Diffstat (limited to 'src/rabbit_mirror_queue_misc.erl')
-rw-r--r--src/rabbit_mirror_queue_misc.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 335b7c81..4ea1d984 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -69,7 +69,7 @@
%% slave (now master) receives messages it's not ready for (for
%% example, new consumers).
%% Returns {ok, NewMPid, DeadPids}
-remove_from_queue(QueueName, Self, DeadGMPids) ->
+remove_from_queue(QueueName, Self, LiveGMPids) ->
rabbit_misc:execute_mnesia_transaction(
fun () ->
%% Someone else could have deleted the queue before we
@@ -79,9 +79,9 @@ remove_from_queue(QueueName, Self, DeadGMPids) ->
[Q = #amqqueue { pid = QPid,
slave_pids = SPids,
gm_pids = GMPids }] ->
- {Dead, GMPids1} = lists:partition(
+ {GMPids1, Dead} = lists:partition(
fun ({GM, _}) ->
- lists:member(GM, DeadGMPids)
+ lists:member(GM, LiveGMPids)
end, GMPids),
DeadPids = [Pid || {_GM, Pid} <- Dead],
Alive = [QPid | SPids] -- DeadPids,