Skip to content

Commit ac59a8d

Browse files
LoisSotoLopezgomoripeti
authored andcommitted
Warn on undefined remote uid while recovering
1 parent 75911ad commit ac59a8d

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

deps/rabbit/src/rabbit_quorum_queue.erl

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,22 @@ repair_amqqueue_nodes(Q0) ->
738738
false ->
739739
TS0#{nodes => RaNodes};
740740
true ->
741-
RaUids = maps:from_list([{N, erpc:call(N, ra_directory, uid_of,
742-
[?RA_SYSTEM, Name],
743-
?RPC_TIMEOUT)}
744-
|| N <- RaNodes]),
741+
RaUidsList = [begin
742+
Uid = erpc:call(N, ra_directory, uid_of,
743+
[?RA_SYSTEM, Name],
744+
?RPC_TIMEOUT),
745+
case Uid of
746+
undefined ->
747+
?LOG_WARNING("Unexpected undefined uuid from node ~p for quorum queue ~ts during repair_amqqueue_nodes",
748+
[N, rabbit_misc:rs(QName)]);
749+
_ ->
750+
ok
751+
end,
752+
{N, Uid}
753+
end
754+
|| N <- RaNodes],
755+
756+
RaUids = maps:from_list(RaUidsList),
745757
TS0#{nodes => RaUids}
746758
end,
747759
amqqueue:set_type_state(Q, TS)
@@ -808,6 +820,13 @@ recover(_Vhost, Queues) ->
808820
QName = amqqueue:get_name(Q),
809821
MutConf = make_mutable_config(Q),
810822
RaUId = ra_directory:uid_of(?RA_SYSTEM, Name),
823+
case RaUId of
824+
undefined ->
825+
?LOG_WARNING("Unexpected undefined uuid for current node for quorum queue ~ts during recover",
826+
[rabbit_misc:rs(QName)]);
827+
_ ->
828+
ok
829+
end,
811830
#{nodes := Nodes} = amqqueue:get_type_state(Q),
812831
case Nodes of
813832
List when is_list(List) ->

0 commit comments

Comments
 (0)