summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2019-09-06 00:27:12 +0300
committerGitHub <noreply@github.com>2019-09-06 00:27:12 +0300
commit5e8d4f1ee624b368f04ba78fdd08a028e6fd98c6 (patch)
tree8d51036f7dfc2c42f47ab1dc0377a0d6ee3abc86
parent2d67486a9f5a8bf4db519b4b292a4224b0fe9108 (diff)
parentdc2552b682633660b75e8b945398f4d6f29ccc32 (diff)
downloadrabbitmq-server-git-5e8d4f1ee624b368f04ba78fdd08a028e6fd98c6.tar.gz
Merge pull request #2096 from tomyouyou/master
call "add_to_journal" before "maybe_flush_pre_publish_cache" in pre_publish
-rw-r--r--src/rabbit_queue_index.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl
index 2805584124..e4f31ab36f 100644
--- a/src/rabbit_queue_index.erl
+++ b/src/rabbit_queue_index.erl
@@ -349,11 +349,11 @@ pre_publish(MsgOrId, SeqId, MsgProps, IsPersistent, IsDelivered, JournalSizeHint
DC
end,
- add_to_journal(SeqId, {IsPersistent, Bin, MsgBin},
- maybe_flush_pre_publish_cache(
+ State2 = add_to_journal(SeqId, {IsPersistent, Bin, MsgBin}, State1),
+ maybe_flush_pre_publish_cache(
JournalSizeHint,
- State1#qistate{pre_publish_cache = PPC1,
- delivered_cache = DC1})).
+ State2#qistate{pre_publish_cache = PPC1,
+ delivered_cache = DC1}).
%% pre_publish_cache is the entry with most elements when compared to
%% delivered_cache so we only check the former in the guard.