Skip to content

Commit 48ca935

Browse files
committed
join
1 parent 894e5b1 commit 48ca935

File tree

1 file changed

+31
-51
lines changed

1 file changed

+31
-51
lines changed

deps/rabbit/src/rabbit_db_cluster.erl

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -196,34 +196,24 @@ join(RemoteNode, NodeType)
196196
%% RabbitMQ and Mnesia must be stopped to modify the cluster. In
197197
%% particular, we stop Mnesia regardless of the remotely selected
198198
%% database because we might change it during the join.
199-
RestartMnesia = rabbit_mnesia:is_running(),
200-
RestartFFCtl = rabbit_ff_controller:is_running(),
201-
RestartRaSystems = rabbit_ra_systems:are_running(),
199+
% RestartMnesia = rabbit_mnesia:is_running(),
200+
% RestartFFCtl = rabbit_ff_controller:is_running(),
202201
RestartRabbit = rabbit:is_running(),
203202
case RestartRabbit of
204203
true ->
205204
rabbit:stop();
206205
false ->
207-
%% The Ra systems were started before we initialize the
208-
%% database (because Khepri depends on one of them).
209-
%% Therefore, there are files in the data directory. They
210-
%% will go away with the reset and we will need to restart
211-
%% Ra systems afterwards.
212-
case RestartRaSystems of
213-
true -> ok = rabbit_ra_systems:ensure_stopped();
214-
false -> ok
215-
end,
216-
217-
case RestartFFCtl of
218-
true ->
219-
ok = rabbit_ff_controller:wait_for_task_and_stop();
220-
false ->
221-
ok
222-
end,
223-
case RestartMnesia of
224-
true -> rabbit_mnesia:stop_mnesia();
225-
false -> ok
226-
end
206+
% case RestartFFCtl of
207+
% true ->
208+
% ok = rabbit_ff_controller:wait_for_task_and_stop();
209+
% false ->
210+
% ok
211+
% end,
212+
% case RestartMnesia of
213+
% true -> rabbit_mnesia:stop_mnesia();
214+
% false -> ok
215+
% end,
216+
ok
227217
end,
228218

229219
%% We acquire the feature flags registry reload lock because
@@ -255,27 +245,16 @@ join(RemoteNode, NodeType)
255245
%% it is meant to be used. That's because we may switch back from
256246
%% Khepri to Mnesia. To be safe, remove possibly stale files from
257247
%% a previous instance where Mnesia was used.
258-
case rabbit_khepri:is_enabled(RemoteNode) of
259-
true -> ok;
260-
false -> ok = rabbit_mnesia:reset_gracefully()
261-
end,
248+
% case rabbit_khepri:is_enabled(RemoteNode) of
249+
% true -> ok;
250+
% false -> ok = rabbit_mnesia:reset_gracefully()
251+
% end,
262252

263-
ok = rabbit_node_monitor:notify_left_cluster(node()),
253+
% ok = rabbit_node_monitor:notify_left_cluster(node()),
264254

265255
%% Now that the files are all gone after the reset above, restart
266256
%% the Ra systems. They will recreate their folder in the process.
267-
case RestartRabbit of
268-
true ->
269-
ok;
270-
false ->
271-
case RestartRaSystems of
272-
true ->
273-
ok = rabbit_ra_systems:ensure_started(),
274-
ok = rabbit_khepri:setup();
275-
false ->
276-
ok
277-
end
278-
end,
257+
% ok = rabbit_khepri:setup(),
279258

280259
?LOG_INFO(
281260
"DB: joining cluster using remote nodes:~n~tp", [ClusterNodes],
@@ -301,17 +280,18 @@ join(RemoteNode, NodeType)
301280
true ->
302281
rabbit:start();
303282
false ->
304-
case RestartFFCtl of
305-
true ->
306-
ok = rabbit_sup:start_child(rabbit_ff_controller);
307-
false ->
308-
ok
309-
end,
310-
NeedMnesia = not rabbit_khepri:is_enabled(),
311-
case RestartMnesia andalso NeedMnesia of
312-
true -> rabbit_mnesia:start_mnesia(false);
313-
false -> ok
314-
end
283+
% case RestartFFCtl of
284+
% true ->
285+
% ok = rabbit_sup:start_child(rabbit_ff_controller);
286+
% false ->
287+
% ok
288+
% end,
289+
% NeedMnesia = not rabbit_khepri:is_enabled(),
290+
% case RestartMnesia andalso NeedMnesia of
291+
% true -> rabbit_mnesia:start_mnesia(false);
292+
% false -> ok
293+
% end,
294+
ok
315295
end,
316296

317297
case Ret of

0 commit comments

Comments
 (0)