Skip to content

Commit c4b9cbf

Browse files
michaelklishinlukebakken
authored andcommitted
Merge pull request #2096 from tomyouyou/master
call "add_to_journal" before "maybe_flush_pre_publish_cache" in pre_publish (cherry picked from commit 5e8d4f1)
1 parent 13bcf9d commit c4b9cbf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rabbit_queue_index.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ pre_publish(MsgOrId, SeqId, MsgProps, IsPersistent, IsDelivered, JournalSizeHint
362362
DC
363363
end,
364364

365-
add_to_journal(SeqId, {IsPersistent, Bin, MsgBin},
366-
maybe_flush_pre_publish_cache(
365+
State2 = add_to_journal(SeqId, {IsPersistent, Bin, MsgBin}, State1),
366+
maybe_flush_pre_publish_cache(
367367
JournalSizeHint,
368-
State1#qistate{pre_publish_cache = PPC1,
369-
delivered_cache = DC1})).
368+
State2#qistate{pre_publish_cache = PPC1,
369+
delivered_cache = DC1}).
370370

371371
%% pre_publish_cache is the entry with most elements when compared to
372372
%% delivered_cache so we only check the former in the guard.

0 commit comments

Comments
 (0)