From 6cbcd690d6002557a34e679a6602bb1166d85bcd Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Mon, 29 Oct 2012 12:29:16 +0000 Subject: 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. --- src/rabbit_mirror_queue_misc.erl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/rabbit_mirror_queue_misc.erl') 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. -- cgit v1.2.1