Skip to content

Commit

Permalink
Revert "Revert "Merge pull request #3216 from rabbitmq/mk-quorum-queu…
Browse files Browse the repository at this point in the history
…e-oldest-known-message-command""

This reverts commit e3afd35.
  • Loading branch information
michaelklishin committed Jul 23, 2021
1 parent 5a84d1b commit 1cac57b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deps/rabbit/src/rabbit_fifo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,19 @@ handle_aux(_RaState, cast, tick, #aux{name = Name,
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}, oldest_entry_timestamp, Aux,
Log, #?MODULE{ra_indexes = Indexes}) ->
Ts = case rabbit_fifo_index:smallest(Indexes) of
%% if there are no entries, we return current timestamp
%% so that any previously obtained entries are considered older than this
undefined ->
erlang:system_time(millisecond);
Idx when is_integer(Idx) ->
{{_, _, {_, Meta, _, _}}, _Log1} = ra_log:fetch(Idx, Log),
#{ts := Timestamp} = Meta,
Timestamp
end,
{reply, {ok, Ts}, Aux, Log};
handle_aux(_RaState, {call, _From}, {peek, Pos}, Aux0,
Log0, MacState) ->
case rabbit_fifo:query_peek(Pos, MacState) of
Expand Down

0 comments on commit 1cac57b

Please sign in to comment.