Skip to content

Commit eb49dcb

Browse files
committed
Clustering
1 parent 72b672e commit eb49dcb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

deps/rabbit/src/rabbit_khepri.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ cli_cluster_status() ->
466466

467467
%% For when Khepri is enabled
468468
init_cluster(ClusterNodes) ->
469+
%% TODO this probably returns an empty list! If we don't know the local nodes, we can't exclude from unclustered nodes and it crashes trying to join with itself. Maybe we have to setup khepri here and not in do_join
470+
%% Ensure the local Khepri store is running before we can join it. It
471+
%% could be stopped if RabbitMQ is not running for instance.
472+
ok = setup(),
473+
khepri:info(?RA_CLUSTER_NAME),
474+
469475
ActualNodes = locally_known_nodes(),
470476
UnclusteredNodes = ClusterNodes -- ActualNodes,
471477
case UnclusteredNodes of
@@ -663,9 +669,7 @@ are_we_clustered_with(Node) ->
663669
%% We're going to fail to join anyway, but for the user is not the same
664670
%% to return 'already a member' than 'inconsistent cluster'.
665671
{AllNodes, _DiscNodes, _RunningNodes} = rabbit_node_monitor:read_cluster_status(),
666-
Ret = lists:member(Node, AllNodes),
667-
rabbit_log:warning("TRACE are_we_clustered_with(~p) ~p", [Node, AllNodes]),
668-
Ret.
672+
lists:member(Node, AllNodes).
669673

670674
node_info() ->
671675
{rabbit_misc:otp_release(), rabbit_misc:version(), cluster_status_from_khepri()}.

0 commit comments

Comments
 (0)