diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-08-29 16:47:05 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-08-29 16:47:05 +0100 |
commit | a02e65fd6d9bfda74d125525f6bdf46fcfd29eab (patch) | |
tree | 183f2e316f15a8efecc7d3e6e416b9de7c9321b9 | |
parent | 4aa312b49ba655ea6e3370432711839407369d5f (diff) | |
download | rabbitmq-server-a02e65fd6d9bfda74d125525f6bdf46fcfd29eab.tar.gz |
revert last change (reset when changing node from disc to ram)
mnesia, mnesia....
For some reason, this approach does not in some cases. For example, starting
with nodes A, B, and C clustered and all disc, the following sequence of
commands causes an error:
$ rabbitmqctl -n A stop_app
$ rabbitmqctl -n B stop_app
$ rabbitmqctl -n B change_cluster_node_type ram # reset happens here
$ rabbitmqctl -n B start_app
$ rabbitmqctl -n A start_app
error happens here:
{error, {cannot_start_application,mnesia,
{shutdown,{mnesia_sup,start,[normal,[]]}}}}
I have no idea why, but it's probably connected to the fact that we can't do
those changes when disc replicas are offline, and probably also related that
operations like leaving the cluster require all the cluster node to be online.
At this point I'd give up and put this limitation in `change_cluster_node_type',
but I want to make sure that these limitations do not have repercussions in
other commands. We should already take care of the "leave cluster when node
offline" case, but there are probably others...
-rw-r--r-- | src/rabbit_mnesia.erl | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 4d731137..dc27e58b 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -291,15 +291,6 @@ 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) -> |