diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-09-16 16:40:11 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-09-16 16:40:11 +0100 |
commit | 3d9ed7cd491a087fa63048111169d10b81576843 (patch) | |
tree | fda95c22db0edb13b96794db021ca131f830d99a | |
parent | c7915f20bf0ef022d4fbb749de40cc7177481693 (diff) | |
download | rabbitmq-server-3d9ed7cd491a087fa63048111169d10b81576843.tar.gz |
Cosmetic to be closer to what's on default.bug25685
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index c92bc1f2..ec57fdc7 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -150,26 +150,22 @@ init_it(Self, GM, Node, QName) -> case mnesia:read({rabbit_queue, QName}) of [Q = #amqqueue { pid = QPid, slave_pids = SPids, gm_pids = GMPids }] -> case [Pid || Pid <- [QPid | SPids], node(Pid) =:= Node] of - [] -> - add_slave(Q, Self, GM), - {new, QPid, GMPids}; - [QPid] -> - case rabbit_misc:is_process_alive(QPid) of - true -> duplicate_live_master; - false -> {stale, QPid} - end; - [SPid] -> - case rabbit_misc:is_process_alive(SPid) of - true -> - existing; - false -> - Q1 = Q#amqqueue { - slave_pids = SPids -- [SPid], - gm_pids = [T || T = {_, S} <- GMPids, - S =/= SPid] }, - add_slave(Q1, Self, GM), - {new, QPid, GMPids} - end + [] -> add_slave(Q, Self, GM), + {new, QPid, GMPids}; + [QPid] -> case rabbit_misc:is_process_alive(QPid) of + true -> duplicate_live_master; + false -> {stale, QPid} + end; + [SPid] -> case rabbit_misc:is_process_alive(SPid) of + true -> existing; + false -> GMPids = [T || T = {_, S} <- GMPids, + S =/= SPid], + Q1 = Q#amqqueue{ + slave_pids = SPids -- [SPid], + gm_pids = GMPids}, + add_slave(Q1, Self, GM), + {new, QPid, GMPids} + end end; [] -> master_in_recovery |