summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mnesia.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 12573fd25e..05af43e05d 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -111,7 +111,9 @@ init() ->
ensure_mnesia_dir(),
case is_virgin_node() of
true -> init_from_config();
- false -> init(node_type(), cluster_nodes(all))
+ false -> NodeType = node_type(),
+ init_db_and_upgrade(cluster_nodes(all), NodeType,
+ NodeType =:= ram)
end,
%% We intuitively expect the global name server to be synced when
%% Mnesia is up. In fact that's not guaranteed to be the case -
@@ -119,9 +121,6 @@ init() ->
ok = global:sync(),
ok.
-init(NodeType, AllNodes) ->
- init_db_and_upgrade(AllNodes, NodeType, NodeType =:= ram).
-
init_from_config() ->
{ok, {TryNodes, NodeType}} =
application:get_env(rabbit, cluster_nodes),
@@ -136,7 +135,7 @@ init_from_config() ->
rabbit_log:warning("Could not find any suitable node amongst the "
"ones provided in the configuration: ~p~n",
[TryNodes]),
- init(disc, [node()])
+ init_db_and_upgrade([node()], disc, false)
end.
%% Make the node join a cluster. The node will be reset automatically