@@ -291,28 +291,21 @@ random_nth(Nodes) ->
291291
292292revive_local_quorum_queue_replicas () ->
293293 Queues = rabbit_amqqueue :list_local_followers (),
294- [begin
295- Name = amqqueue :get_name (Q ),
296- rabbit_log :debug (" Will trigger a leader election for local quorum queue ~ts " ,
297- [rabbit_misc :rs (Name )]),
298- % % start local QQ replica (Ra server) of this queue
299- {Prefix , _Node } = amqqueue :get_pid (Q ),
300- RaServer = {Prefix , node ()},
301- rabbit_log :debug (" Will start quorum queue replica (Ra server) ~tp " , [RaServer ]),
302- case rabbit_quorum_queue :restart_server (RaServer ) of
303- ok ->
304- rabbit_log :debug (" Successfully restarted a quorum queue replica ~tp " , [RaServer ]);
305- {error , {already_started , _Pid }} ->
306- rabbit_log :debug (" Quorum queue replica ~tp is already running" , [RaServer ]);
307- {error , nodedown } ->
308- rabbit_log :error (" Failed to restart quorum queue replica ~tp : target node was reported as down" , [RaServer ]);
309- {error , name_not_registered } ->
310- rabbit_log :error (" Failed to restart quorum queue replica ~tp : it reported as not registered (was deleted very recently?)" , [RaServer ]);
311- {error , Other } ->
312- rabbit_log :error (" Failed to restart quorum queue replica ~tp : ~tp " , [RaServer , Other ])
313- end
314- end || Q <- Queues ],
315- rabbit_log :info (" Restart of local quorum queue replicas is complete" ).
294+ % % NB: this function ignores the first argument so we can just pass the
295+ % % empty binary as the vhost name.
296+ {Recovered , Failed } = rabbit_quorum_queue :recover (<<>>, Queues ),
297+ rabbit_log :debug (" Successfully revived ~b quorum queue replicas" ,
298+ [length (Recovered )]),
299+ case length (Failed ) of
300+ 0 ->
301+ ok ;
302+ NumFailed ->
303+ rabbit_log :error (" Failed to revive ~b quorum queue replicas" ,
304+ [NumFailed ])
305+ end ,
306+
307+ rabbit_log :info (" Restart of local quorum queue replicas is complete" ),
308+ ok .
316309
317310% %
318311% % Implementation
0 commit comments