summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Nilsson <kjnilsson@gmail.com>2021-09-20 12:19:22 +0100
committermergify-bot <noreply@mergify.io>2021-09-20 15:30:20 +0000
commitdc43970dd665fbebffc90fbdcd534d6126f9db85 (patch)
tree4e09a4af0dbe6f53c024bb89459165608b3fa6b2
parenta787a9257692c2bbee2af80a39e40380340976be (diff)
downloadrabbitmq-server-git-mergify/bp/v3.9.x/pr-3448.tar.gz
Emit release cursor for more commandsmergify/bp/v3.9.x/pr-3448
It should be rare that repeated use of these commands would grow the Raft log excessively but just incase we evaluate the release cursors here anyway so that if the queue is empty we may trigger a snapshot anyway. (cherry picked from commit ee6ef35873e7e9d08ca29700d965c90cb4cc3f98)
-rw-r--r--deps/rabbit/src/rabbit_fifo.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/rabbit/src/rabbit_fifo.erl b/deps/rabbit/src/rabbit_fifo.erl
index ddc517a971..71172fce70 100644
--- a/deps/rabbit/src/rabbit_fifo.erl
+++ b/deps/rabbit/src/rabbit_fifo.erl
@@ -509,13 +509,14 @@ apply(Meta, {nodeup, Node}, #?MODULE{consumers = Cons0,
checkout(Meta, State0, State, Effects);
apply(_, {nodedown, _Node}, State) ->
{State, ok};
-apply(Meta, #purge_nodes{nodes = Nodes}, State0) ->
+apply(#{index := Idx} = Meta, #purge_nodes{nodes = Nodes}, State0) ->
{State, Effects} = lists:foldl(fun(Node, {S, E}) ->
purge_node(Meta, Node, S, E)
end, {State0, []}, Nodes),
- {State, ok, Effects};
-apply(Meta, #update_config{config = Conf}, State) ->
- checkout(Meta, State, update_config(Conf, State), []);
+ update_smallest_raft_index(Idx, ok, State, Effects);
+apply(#{index := Idx} = Meta, #update_config{config = Conf}, State0) ->
+ {State, Reply, Effects} = checkout(Meta, State0, update_config(Conf, State0), []),
+ update_smallest_raft_index(Idx, Reply, State, Effects);
apply(_Meta, {machine_version, 0, 1}, V0State) ->
State = convert_v0_to_v1(V0State),
{State, ok, []};