diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-16 13:09:21 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-16 13:09:21 +0100 |
| commit | fa3ab5eac41ec0d00eeed03ee2e841d6eee34a1c (patch) | |
| tree | 00f33607b000d439fb735d369c60cf82875827e0 /src | |
| parent | 58046f0d23e868dc5dac86ba275cdf4e0be71661 (diff) | |
| download | rabbitmq-server-git-fa3ab5eac41ec0d00eeed03ee2e841d6eee34a1c.tar.gz | |
We don't need the 'existing' records, and without them we don't need to compare GMPids for sameness.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mirror_queue_misc.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl index d1de786103..48cbf64526 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 ff0ac9cd27..7aa9c31fb9 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, |
