Skip to content

Commit

Permalink
rabbitmq-upgrade revive: handle more errors
Browse files Browse the repository at this point in the history
returned by Ra, e.g. when a replica cannot be
restarted because of a concurrent delete
or because a QQ was inserted into a schema data
store but not yet registered as a process on
the node.

References #12013.
  • Loading branch information
michaelklishin committed Aug 15, 2024
1 parent cabe873 commit 2f165e0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions deps/rabbit/src/rabbit_maintenance.erl
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,18 @@ revive_local_quorum_queue_replicas() ->
%% start local QQ replica (Ra server) of this queue
{Prefix, _Node} = amqqueue:get_pid(Q),
RaServer = {Prefix, node()},
rabbit_log:debug("Will start Ra server ~tp", [RaServer]),
rabbit_log:debug("Will start quorum queue replica (Ra server) ~tp", [RaServer]),
case rabbit_quorum_queue:restart_server(RaServer) of
ok ->
rabbit_log:debug("Successfully restarted Ra server ~tp", [RaServer]);
rabbit_log:debug("Successfully restarted a quorum queue replica ~tp", [RaServer]);
{error, {already_started, _Pid}} ->
rabbit_log:debug("Ra server ~tp is already running", [RaServer]);
rabbit_log:debug("Quorum queue replica ~tp is already running", [RaServer]);
{error, nodedown} ->
rabbit_log:error("Failed to restart Ra server ~tp: target node was reported as down")
rabbit_log:error("Failed to restart quorum queue replica ~tp: target node was reported as down", [RaServer]);
{error, name_not_registered} ->
rabbit_log:error("Failed to restart quorum queue replica ~tp: it reported as not registered (was deleted very recently?)", [RaServer]);
{error, Other} ->
rabbit_log:error("Failed to restart quorum queue replica ~tp: ~tp", [RaServer, Other])
end
end || Q <- Queues],
rabbit_log:info("Restart of local quorum queue replicas is complete").
Expand Down

0 comments on commit 2f165e0

Please sign in to comment.