summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Nilsson <kjnilsson@gmail.com>2021-09-20 12:19:22 +0100
committerKarl Nilsson <kjnilsson@gmail.com>2021-09-20 12:19:22 +0100
commitee6ef35873e7e9d08ca29700d965c90cb4cc3f98 (patch)
treea7aac29a5db852180e4ab315c4ee64d56b565b62
parenteaa216da8246a2fc79108e3e0780996ab2bc11ac (diff)
downloadrabbitmq-server-git-qq-consumer-cancellation-fixes.tar.gz
Emit release cursor for more commandsqq-consumer-cancellation-fixes
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.
-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, []};