Skip to content

Commit ee6ef35

Browse files
committed
Emit release cursor for more commands
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.
1 parent eaa216d commit ee6ef35

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

deps/rabbit/src/rabbit_fifo.erl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,14 @@ apply(Meta, {nodeup, Node}, #?MODULE{consumers = Cons0,
509509
checkout(Meta, State0, State, Effects);
510510
apply(_, {nodedown, _Node}, State) ->
511511
{State, ok};
512-
apply(Meta, #purge_nodes{nodes = Nodes}, State0) ->
512+
apply(#{index := Idx} = Meta, #purge_nodes{nodes = Nodes}, State0) ->
513513
{State, Effects} = lists:foldl(fun(Node, {S, E}) ->
514514
purge_node(Meta, Node, S, E)
515515
end, {State0, []}, Nodes),
516-
{State, ok, Effects};
517-
apply(Meta, #update_config{config = Conf}, State) ->
518-
checkout(Meta, State, update_config(Conf, State), []);
516+
update_smallest_raft_index(Idx, ok, State, Effects);
517+
apply(#{index := Idx} = Meta, #update_config{config = Conf}, State0) ->
518+
{State, Reply, Effects} = checkout(Meta, State0, update_config(Conf, State0), []),
519+
update_smallest_raft_index(Idx, Reply, State, Effects);
519520
apply(_Meta, {machine_version, 0, 1}, V0State) ->
520521
State = convert_v0_to_v1(V0State),
521522
{State, ok, []};

0 commit comments

Comments
 (0)