summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-08-29 15:10:52 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-08-29 15:10:52 +0100
commit4aa312b49ba655ea6e3370432711839407369d5f (patch)
tree1a4a29fec5b14dd4db2c0dfb55afbcbbe55131c5
parentad8f703bc83f7cc4f79d2275ab71adcd8e27b021 (diff)
downloadrabbitmq-server-4aa312b49ba655ea6e3370432711839407369d5f.tar.gz
reset when turning disc into ram node
-rw-r--r--src/rabbit_mnesia.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index dc27e58b..4d731137 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -291,6 +291,15 @@ change_cluster_node_type(Type) ->
"disc nodes to the cluster first."}});
false -> ok
end,
+ %% This is an horrible hack due to
+ %% <http://erlang.org/pipermail/erlang-questions/2012-August/068696.html>.
+ %% This is safe if the cluster situation remains the same between the
+ %% cluster discovery and joining the cluster, but if for example the other
+ %% cluster nodes disappear in that timeframe we are in trouble.
+ ok = case is_disc_node() andalso not WantDiscNode of
+ true -> reset(false);
+ false -> ok
+ end,
ok = init_db_with_mnesia(AllNodes, WantDiscNode, false).
update_cluster_nodes(DiscoveryNode) ->