Skip to content

Commit

Permalink
More efficient way to check queue members
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonUnge committed May 22, 2024
1 parent 204900f commit 09a827a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions deps/rabbit/src/rabbit_quorum_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,12 @@ handle_tick(QName,
| info(Q, Keys)],
rabbit_core_metrics:queue_stats(QName, Infos),
ok = repair_leader_record(Q, Self),
repair_amqqueue_nodes(Q),
case repair_amqqueue_nodes(Q) of
ok ->
ok;
repaired ->
rabbit_log:debug("Repaired quorum queue ~ts amqqueue record", [rabbit_misc:rs(QName)])
end,
ExpectedNodes = rabbit_nodes:list_members(),
case Nodes -- ExpectedNodes of
[] ->
Expand Down Expand Up @@ -605,8 +610,8 @@ repair_amqqueue_nodes(QName = #resource{}) ->
repair_amqqueue_nodes(Q0);
repair_amqqueue_nodes(Q0) ->
QName = amqqueue:get_name(Q0),
Leader = amqqueue:get_pid(Q0),
{ok, Members, _} = ra:members(Leader),
{Name, _} = amqqueue:get_pid(Q0),
Members = ra_leaderboard:lookup_members(Name),
RaNodes = [N || {_, N} <- Members],
#{nodes := Nodes} = amqqueue:get_type_state(Q0),
case lists:sort(RaNodes) =:= lists:sort(Nodes) of
Expand Down

0 comments on commit 09a827a

Please sign in to comment.