Skip to content

Commit eb1b636

Browse files
committed
rabbit_mirror_queue_master: is_duplicate drop duplicate messages
Inform the amqqueue process to drop a duplicate message if so. Signed-off-by: Matteo Cafasso <[email protected]>
1 parent 0cc04a1 commit eb1b636

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rabbit_mirror_queue_master.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ is_duplicate(Message = #basic_message { id = MsgId },
462462
%% immediately after calling is_duplicate). The msg is
463463
%% invalid. We will not see this again, nor will we be
464464
%% further involved in confirming this message, so erase.
465-
{true, State #state { seen_status = maps:remove(MsgId, SS) }};
465+
{{true, drop}, State #state { seen_status = maps:remove(MsgId, SS) }};
466466
{ok, Disposition}
467467
when Disposition =:= confirmed
468468
%% It got published when we were a slave via gm, and
@@ -477,8 +477,8 @@ is_duplicate(Message = #basic_message { id = MsgId },
477477
%% Message was discarded while we were a slave. Confirm now.
478478
%% As above, amqqueue_process will have the entry for the
479479
%% msg_id_to_channel mapping.
480-
{true, State #state { seen_status = maps:remove(MsgId, SS),
481-
confirmed = [MsgId | Confirmed] }}
480+
{{true, drop}, State #state { seen_status = maps:remove(MsgId, SS),
481+
confirmed = [MsgId | Confirmed] }}
482482
end.
483483

484484
set_queue_mode(Mode, State = #state { gm = GM,

0 commit comments

Comments
 (0)