diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-07-20 14:06:36 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-07-20 14:06:36 +0100 |
| commit | 77f12b1bb344392f84649b640666c6683ae05c52 (patch) | |
| tree | 0709c510926e67d79042eb3a65d361ad93a75d66 | |
| parent | 1888720f4890ef06057099642cae84273d0d2c81 (diff) | |
| download | rabbitmq-server-git-77f12b1bb344392f84649b640666c6683ae05c52.tar.gz | |
Flip flop again: revert b69bd74d8e17 and add the old master pid to the promoted message - we want to identify queues by pids in mgmt.
| -rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 001b0d0031..308cc211d1 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -422,8 +422,10 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName }, sender_queues = SQ, msg_id_ack = MA, msg_id_status = MS, - known_senders = KS }) -> - rabbit_event:notify(queue_slave_promoted, [{name, QName}, {pid, self()}]), + known_senders = KS, + master_pid = MPid}) -> + rabbit_event:notify(queue_slave_promoted, [{pid, self()}, + {old_pid, MPid}]), rabbit_log:info("Mirrored-queue (~s): Promoting slave ~s to master~n", [rabbit_misc:rs(QName), rabbit_misc:pid_to_string(self())]), Q1 = Q #amqqueue { pid = self() }, @@ -893,10 +895,10 @@ maybe_store_ack(true, MsgId, AckTag, State = #state { msg_id_ack = MA, %% We intentionally leave out the head where a slave becomes %% unsynchronised: we assert that can never happen. -set_synchronised(true, State = #state { q = #amqqueue{name = QName}, +set_synchronised(true, State = #state { master_pid = MasterPid, synchronised = false }) -> - rabbit_event:notify(queue_slave_synchronised, [{name, QName}, - {pid, self()}]), + rabbit_event:notify(queue_slave_synchronised, [{master_pid, MasterPid}, + {pid, self()}]), State #state { synchronised = true }; set_synchronised(true, State) -> State; |
