Skip to content

Commit

Permalink
Fix rabbit_stream_queue:get_counters querying writer last
Browse files Browse the repository at this point in the history
`rabbit_steam_coordinator:stream_overview/1` returns the member in
different format than `members/1`, resulting in `is_writer/1` never
matching. This was changed in PR #6440. This prevents getting counters
from stream writer last as intended by PR #6442.
  • Loading branch information
gomoripeti committed May 22, 2023
1 parent 1196fcc commit e9e2178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deps/rabbit/src/rabbit_stream_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ is_writer(_Member) -> false.

get_counters(Q) ->
#{name := StreamId} = amqqueue:get_type_state(Q),
{ok, #{members := Members}} = rabbit_stream_coordinator:stream_overview(StreamId),
{ok, Members} = rabbit_stream_coordinator:members(StreamId),
%% split members to query the writer last
%% this minimizes the risk of confusing output where replicas are ahead of the writer
Writer = maps:keys(maps:filter(fun (_, M) -> is_writer(M) end, Members)),
Expand Down

0 comments on commit e9e2178

Please sign in to comment.