diff options
author | Loïc Hoguin <lhoguin@vmware.com> | 2023-02-02 10:28:35 +0100 |
---|---|---|
committer | Loïc Hoguin <lhoguin@vmware.com> | 2023-02-02 10:28:35 +0100 |
commit | 87fdf7719a941077b74f53c9ac0b2a5cd290a1e8 (patch) | |
tree | 044da011fd87e1d9052b2215aa7f4733ce376a1f | |
parent | 70094e6c1f2cf18e9b51f51d2468c1aaaf4d32e1 (diff) | |
download | rabbitmq-server-git-cq-dont-confirm-on-remove.tar.gz |
CQ: Don't confirm on remove from old message storecq-dont-confirm-on-remove
The confirms will instead be sent when the message store syncs
to disk. The problem with doing confirms on remove is that it
happens far too often and it brings down the overall performance
despite sending the confirms earlier.
-rw-r--r-- | deps/rabbit/src/rabbit_msg_store.erl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/deps/rabbit/src/rabbit_msg_store.erl b/deps/rabbit/src/rabbit_msg_store.erl index 06e993c8d3..6762dce113 100644 --- a/deps/rabbit/src/rabbit_msg_store.erl +++ b/deps/rabbit/src/rabbit_msg_store.erl @@ -927,17 +927,15 @@ handle_cast({write, CRef, MsgId, Flow}, end; handle_cast({remove, CRef, MsgIds}, State) -> - {RemovedMsgIds, State1} = + State1 = lists:foldl( - fun (MsgId, {Removed, State2}) -> + fun (MsgId, State2) -> case update_flying(+1, MsgId, CRef, State2) of - process -> {[MsgId | Removed], - remove_message(MsgId, CRef, State2)}; - ignore -> {Removed, State2} + process -> remove_message(MsgId, CRef, State2); + ignore -> State2 end - end, {[], State}, MsgIds), - noreply(maybe_compact(client_confirm(CRef, sets:from_list(RemovedMsgIds, [{version, 2}]), - ignored, State1))); + end, State, MsgIds), + noreply(maybe_compact(State1)); handle_cast({combine_files, Source, Destination, Reclaimed}, State = #msstate { sum_file_size = SumFileSize, |