diff options
-rw-r--r-- | deps/rabbit/src/rabbit_fifo.erl | 6 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_fifo_SUITE.erl | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/deps/rabbit/src/rabbit_fifo.erl b/deps/rabbit/src/rabbit_fifo.erl index 3b5b9f5e40..a60ca7f556 100644 --- a/deps/rabbit/src/rabbit_fifo.erl +++ b/deps/rabbit/src/rabbit_fifo.erl @@ -677,7 +677,8 @@ state_enter(eol, #?MODULE{enqueuers = Enqs, AllConsumers = maps:merge(Custs, WaitingConsumers1), [{send_msg, P, eol, ra_event} || P <- maps:keys(maps:merge(Enqs, AllConsumers))] ++ - [{mod_call, rabbit_quorum_queue, file_handle_release_reservation, []}]; + [{aux, eol}, + {mod_call, rabbit_quorum_queue, file_handle_release_reservation, []}]; state_enter(State, #?MODULE{cfg = #cfg{resource = _Resource}}) when State =/= leader -> FHReservation = {mod_call, rabbit_quorum_queue, file_handle_other_reservation, []}, [FHReservation]; @@ -790,6 +791,9 @@ handle_aux(_RaState, cast, tick, #aux{name = Name, {Name, utilisation(Use0)}), Aux = eval_gc(Log, MacState, State0), {no_reply, Aux, Log}; +handle_aux(_RaState, cast, eol, #aux{name = Name} = Aux, Log, _) -> + ets:delete(rabbit_fifo_usage, Name), + {no_reply, Aux, Log}; handle_aux(_RaState, {call, _From}, {peek, Pos}, Aux0, Log0, MacState) -> case rabbit_fifo:query_peek(Pos, MacState) of diff --git a/deps/rabbit/test/rabbit_fifo_SUITE.erl b/deps/rabbit/test/rabbit_fifo_SUITE.erl index 1b8761f90e..a5cf45908d 100644 --- a/deps/rabbit/test/rabbit_fifo_SUITE.erl +++ b/deps/rabbit/test/rabbit_fifo_SUITE.erl @@ -1036,7 +1036,8 @@ single_active_consumer_state_enter_eol_include_waiting_consumers_test(_) -> Effects = rabbit_fifo:state_enter(eol, State1), %% 1 effect for each consumer process (channel process), %% 1 effect for file handle reservation - ?assertEqual(4, length(Effects)). + %% 1 effect for eol to handle rabbit_fifo_usage entries + ?assertEqual(5, length(Effects)). query_consumers_test(_) -> State0 = init(#{name => ?FUNCTION_NAME, |