summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_amqqueue_process.erl6
-rw-r--r--src/rabbit_mirror_queue_slave.erl14
2 files changed, 9 insertions, 11 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 81e260bdda..d8cd510b39 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -142,10 +142,8 @@ init_with_backing_queue_state(Q = #amqqueue{exclusive_owner = Owner}, BQ, BQS,
stats_timer = rabbit_event:init_stats_timer(),
msg_id_to_channel = MTC})),
lists:foldl(
- fun (Delivery, StateN) ->
- {_Delivered, StateN1} = deliver_or_enqueue(Delivery, StateN),
- StateN1
- end, State, Deliveries).
+ fun (Delivery, StateN) -> deliver_or_enqueue(Delivery, StateN) end,
+ State, Deliveries).
terminate(shutdown, State = #q{backing_queue = BQ}) ->
terminate_shutdown(fun (BQS) -> BQ:terminate(BQS) end, State);
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 6369e11463..57ddf8db6a 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -222,7 +222,7 @@ terminate(Reason, #state { q = Q,
rate_timer_ref = RateTRef }) ->
ok = gm:leave(GM),
QueueState = rabbit_amqqueue_process:init_with_backing_queue_state(
- Q, BQ, BQS, RateTRef, [], []),
+ Q, BQ, BQS, RateTRef, [], [], dict:new()),
rabbit_amqqueue_process:terminate(Reason, QueueState);
terminate([_SPid], _Reason) ->
%% gm case
@@ -411,17 +411,17 @@ promote_me(From, #state { q = Q,
%% this does not affect MS, nor which bits go through to SS in
%% Master, or MTC in queue_process.
- SS = dict:filter(fun ({published, _ChPid}) -> true;
- ({published, _ChPid, _MsgSeqNo}) -> false;
- ({confirmed, _ChPid}) -> true
+ SS = dict:filter(fun (_MsgId, {published, _ChPid}) -> true;
+ (_MsgId, {published, _ChPid, _MsgSeqNo}) -> false;
+ (_MsgId, {confirmed, _ChPid}) -> true
end, MS),
MasterState = rabbit_mirror_queue_master:promote_backing_queue_state(
CPid, BQ, BQS, GM, SS),
- MTC = dict:filter(fun ({published, _ChPid}) -> false;
- ({published, _ChPid, _MsgSeqNo}) -> true;
- ({confirmed, _ChPid}) -> false
+ MTC = dict:filter(fun (_MsgId, {published, _ChPid}) -> false;
+ (_MsgId, {published, _ChPid, _MsgSeqNo}) -> true;
+ (_MsgId, {confirmed, _ChPid}) -> false
end, MS),
AckTags = [AckTag || {_MsgId, AckTag} <- dict:to_list(MA)],
Deliveries = [Delivery || {_ChPid, PubQ} <- dict:to_list(SQ),