From e82f62ba20f9fb71aee06bdf84d810fc538a16bd Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 15 Aug 2024 10:02:02 -0400 Subject: [PATCH] rabbitmq-upgrade revive: handle more errors 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. (cherry picked from commit 2f165e02f2e57a3a2f1bf379579f6ff4d46cf324) --- deps/rabbit/src/rabbit_maintenance.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deps/rabbit/src/rabbit_maintenance.erl b/deps/rabbit/src/rabbit_maintenance.erl index e21526bee337..d0af537a9073 100644 --- a/deps/rabbit/src/rabbit_maintenance.erl +++ b/deps/rabbit/src/rabbit_maintenance.erl @@ -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").