Skip to content

Commit 1aac220

Browse files
author
Simon MacMullen
committed
Merge bug 24608 (qproc and mirror_slave disagree on data structure for msg_id_to_channel)
2 parents d297dfb + ae1bb4d commit 1aac220

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rabbit_mirror_queue_slave.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,11 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName },
526526
MasterState = rabbit_mirror_queue_master:promote_backing_queue_state(
527527
CPid, BQ, BQS, GM, SS, MonitoringPids),
528528

529-
MTC = dict:from_list(
530-
[{MsgId, {ChPid, MsgSeqNo}} ||
531-
{MsgId, {published, ChPid, MsgSeqNo}} <- dict:to_list(MS)]),
529+
MTC = lists:foldl(fun ({MsgId, {published, ChPid, MsgSeqNo}}, MTC0) ->
530+
gb_trees:insert(MsgId, {ChPid, MsgSeqNo}, MTC0);
531+
(_, MTC0) ->
532+
MTC0
533+
end, gb_trees:empty(), MSList),
532534
NumAckTags = [NumAckTag || {_MsgId, NumAckTag} <- dict:to_list(MA)],
533535
AckTags = [AckTag || {_Num, AckTag} <- lists:sort(NumAckTags)],
534536
Deliveries = [Delivery || {_ChPid, {PubQ, _PendCh}} <- dict:to_list(SQ),

0 commit comments

Comments
 (0)