Skip to content

Commit

Permalink
Let QQs check if it needs to repair amqqueue nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonUnge committed May 29, 2024
1 parent ea9c637 commit 83a0eed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deps/rabbit/src/rabbit_quorum_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ handle_tick(QName,
| info(Q, Keys)],
rabbit_core_metrics:queue_stats(QName, Infos),
ok = repair_leader_record(Q, Self),
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 @@ -604,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 83a0eed

Please sign in to comment.