diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-08 18:02:16 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-08 18:02:16 +0100 |
commit | 70766ad51b4e1cfd2b5ee359291400d86706404d (patch) | |
tree | f91aa05951893a8edd2dae1b59a151a667e7a26c | |
parent | 1fbba866b471d3260efca33761d788004eb67231 (diff) | |
download | rabbitmq-server-bug25210.tar.gz |
Removing the ExtraNodes stuff unmasked another bug: we weren't cleaning up slave_pids when stopping mirroring.bug25210
-rw-r--r-- | src/rabbit_mirror_queue_master.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl index ea98430c..d865d675 100644 --- a/src/rabbit_mirror_queue_master.erl +++ b/src/rabbit_mirror_queue_master.erl @@ -149,7 +149,17 @@ stop_all_slaves(Reason, #state{gm = GM}) -> MRefs = [erlang:monitor(process, S) || S <- Slaves], ok = gm:broadcast(GM, {delete_and_terminate, Reason}), [receive {'DOWN', MRef, process, _Pid, _Info} -> ok end || MRef <- MRefs], - ok = gm:forget_group(proplists:get_value(group_name, Info)). + %% Normally when we remove a slave another slave or master will + %% notice and update Mnesia. But we just removed them all, and + %% have stopped listening ourselves. So manually clean up. + QName = proplists:get_value(group_name, Info), + rabbit_misc:execute_mnesia_transaction( + fun () -> + [Q] = mnesia:read({rabbit_queue, QName}), + rabbit_mirror_queue_misc:store_updated_slaves( + Q #amqqueue { slave_pids = [] }) + end), + ok = gm:forget_group(QName). purge(State = #state { gm = GM, backing_queue = BQ, |