diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-29 12:29:16 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-29 12:29:16 +0000 |
commit | 6cbcd690d6002557a34e679a6602bb1166d85bcd (patch) | |
tree | d531f2e313bc36e67ec18ac48b970697b7abda03 /src/rabbit_mirror_queue_misc.erl | |
parent | 80aeefa480350a549e8b8dd3338d82361b059410 (diff) | |
download | rabbitmq-server-6cbcd690d6002557a34e679a6602bb1166d85bcd.tar.gz |
Since bug 25243 we can never have the situation described in that comment - so remove the extra call to update_mirrors0/2 and get start_mirroring to start the mirrors itself. I think this is clearer.
Diffstat (limited to 'src/rabbit_mirror_queue_misc.erl')
-rw-r--r-- | src/rabbit_mirror_queue_misc.erl | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl index 8a363f76..92ccc79d 100644 --- a/src/rabbit_mirror_queue_misc.erl +++ b/src/rabbit_mirror_queue_misc.erl @@ -318,19 +318,12 @@ is_mirrored(Q) -> _ -> false end. - -%% [1] - rabbit_amqqueue:start_mirroring/1 will turn unmirrored to -%% master and start any needed slaves. However, if node(QPid) is not -%% in the nodes for the policy, it won't switch it. So this is for the -%% case where we kill the existing queue and restart elsewhere. TODO: -%% is this TRTTD? All alternatives seem ugly. update_mirrors(OldQ = #amqqueue{pid = QPid}, NewQ = #amqqueue{pid = QPid}) -> case {is_mirrored(OldQ), is_mirrored(NewQ)} of {false, false} -> ok; {true, false} -> rabbit_amqqueue:stop_mirroring(QPid); - {false, true} -> rabbit_amqqueue:start_mirroring(QPid), - update_mirrors0(OldQ, NewQ); %% [1] + {false, true} -> rabbit_amqqueue:start_mirroring(QPid); {true, true} -> update_mirrors0(OldQ, NewQ) end. |