diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-12-02 16:43:41 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-12-02 16:43:41 +0000 |
commit | 138b2609f984c69e714b192a9142e7a0f9dabc9f (patch) | |
tree | 2a39ee6084f4c7f0287dd87ec6fd3b035daa7e1f | |
parent | 173a6f2b0d85332ab71c6a113f69b99f559265fe (diff) | |
parent | 890fb19843e343c6c3bbc2604af564a1b96a0376 (diff) | |
download | rabbitmq-server-138b2609f984c69e714b192a9142e7a0f9dabc9f.tar.gz |
Merge bug 24608 (qproc and mirror_slave disagree on data structure for msg_id_to_channel)
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 73eaed14..d68063db 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -526,9 +526,11 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName }, MasterState = rabbit_mirror_queue_master:promote_backing_queue_state( CPid, BQ, BQS, GM, SS, MonitoringPids), - MTC = dict:from_list( - [{MsgId, {ChPid, MsgSeqNo}} || - {MsgId, {published, ChPid, MsgSeqNo}} <- dict:to_list(MS)]), + MTC = lists:foldl(fun ({MsgId, {published, ChPid, MsgSeqNo}}, MTC0) -> + gb_trees:insert(MsgId, {ChPid, MsgSeqNo}, MTC0); + (_, MTC0) -> + MTC0 + end, gb_trees:empty(), MSList), NumAckTags = [NumAckTag || {_MsgId, NumAckTag} <- dict:to_list(MA)], AckTags = [AckTag || {_Num, AckTag} <- lists:sort(NumAckTags)], Deliveries = [Delivery || {_ChPid, {PubQ, _PendCh}} <- dict:to_list(SQ), |