Skip to content

Commit 7a5e904

Browse files
authored
Merge pull request #9757 from rabbitmq/improve-are_cmqs_user-callback
rabbit_deprecated_features: Improve reliability of the `classic_queue_mirroring` callback
2 parents c13397b + 5f94cf1 commit 7a5e904

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

deps/rabbit/src/rabbit_mirror_queue_misc.erl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ are_cmqs_permitted() ->
951951
are_cmqs_used(_) ->
952952
case rabbit_khepri:get_feature_state() of
953953
enabled ->
954-
are_cmqs_used1();
954+
false;
955955
_ ->
956956
%% If we are using Mnesia, we want to check manually if the table
957957
%% exists first. Otherwise it can conflict with the way
@@ -962,8 +962,16 @@ are_cmqs_used(_) ->
962962
RuntimeParamsReady = lists:member(
963963
rabbit_runtime_parameters, AllTables),
964964
case RuntimeParamsReady of
965-
true -> are_cmqs_used1();
966-
false -> false
965+
true ->
966+
%% We also wait for the table because it could exist but
967+
%% may be unavailable. For instance, Mnesia needs another
968+
%% replica on another node before it considers it to be
969+
%% available.
970+
rabbit_table:wait(
971+
[rabbit_runtime_parameters], _Retry = true),
972+
are_cmqs_used1();
973+
false ->
974+
false
967975
end
968976
end.
969977

0 commit comments

Comments
 (0)