summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-10-16 13:09:21 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-10-16 13:09:21 +0100
commitc55a4aacc8de48bb3824a7b82507f7104a0a79b4 (patch)
tree00f33607b000d439fb735d369c60cf82875827e0
parente13235921c44b37bba3f6f855f97d1e68f4558f8 (diff)
downloadrabbitmq-server-c55a4aacc8de48bb3824a7b82507f7104a0a79b4.tar.gz
We don't need the 'existing' records, and without them we don't need to compare GMPids for sameness.
-rw-r--r--src/rabbit_mirror_queue_misc.erl6
-rw-r--r--src/rabbit_mirror_queue_slave.erl5
2 files changed, 4 insertions, 7 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index d1de7861..48cbf645 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -73,12 +73,12 @@ remove_from_queue(QueueName, DeadGMPids) ->
fun ({GM, _}) ->
lists:member(GM, DeadGMPids)
end, GMPids),
- DeadPids = [Pid || {_GM, Pid} <- Dead, Pid =/= existing],
+ DeadPids = [Pid || {_GM, Pid} <- Dead],
Alive = [QPid | SPids] -- DeadPids,
{QPid1, SPids1} = promote_slave(Alive),
-
- case {{QPid, SPids, GMPids}, {QPid1, SPids1, GMPids1}} of
+ case {{QPid, SPids}, {QPid1, SPids1}} of
{Same, Same} ->
+ GMPids = GMPids1, %% ASSERTION
{ok, QPid1, []};
_ when QPid =:= QPid1 orelse node(QPid1) =:= node() ->
%% Either master hasn't changed, so
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index ff0ac9cd..7aa9c31f 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -156,10 +156,7 @@ init_it(Self, GM, Node, QueueName) ->
false -> {stale, QPid}
end;
[SPid] -> case rabbit_misc:is_process_alive(SPid) of
- true -> Q1 = Q#amqqueue { gm_pids = [{GM, existing} |
- GMPids] },
- ok = rabbit_amqqueue:store_queue(Q1),
- existing;
+ true -> existing;
false -> Q1 = Q#amqqueue {
slave_pids = SPids -- [SPid],
gm_pids = [T || T = {_, S} <- GMPids,