summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-03-16 13:08:22 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2011-03-16 13:08:22 +0000
commit2bd132d6f1d8e06adb8dc00cce06c6272b29030c (patch)
treed6751a4b721124b66fc8c29e440b1ee574edbc4d
parente144a091d293a8b3f20720e777aac53406c5b088 (diff)
downloadrabbitmq-server-git-2bd132d6f1d8e06adb8dc00cce06c6272b29030c.tar.gz
A different and largely opposite version of 'never'...
-rw-r--r--src/rabbit_mirror_queue_slave.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index d20b00d423..fd50162452 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -313,7 +313,6 @@ confirm_messages(MsgIds, State = #state { msg_id_status = MS }) ->
{MS1, CMs} =
lists:foldl(
fun (MsgId, {MSN, CMsN} = Acc) ->
- %% We will never see {confirmed, ChPid} here.
case dict:find(MsgId, MSN) of
error ->
%% If it needed confirming, it'll have
@@ -327,7 +326,14 @@ confirm_messages(MsgIds, State = #state { msg_id_status = MS }) ->
%% Seen from both GM and Channel. Can now
%% confirm.
{dict:erase(MsgId, MSN),
- gb_trees_cons(ChPid, MsgSeqNo, CMsN)}
+ gb_trees_cons(ChPid, MsgSeqNo, CMsN)};
+ {ok, {confirmed, ChPid}} ->
+ %% It's already been confirmed. This is
+ %% probably it's been both sync'd to disk
+ %% and then delivered and ack'd before we've
+ %% seen the publish from the
+ %% channel. Nothing to do here.
+ Acc
end
end, {MS, gb_trees:empty()}, MsgIds),
gb_trees:map(fun (ChPid, MsgSeqNos) ->