diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-02-01 13:38:31 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-02-01 13:38:31 +0000 |
| commit | 1ff50f4f37bf579a9b46990098236a16bb5dcb95 (patch) | |
| tree | 673878d5b85c8c6c6854eb6254a0c1044b37c28f | |
| parent | 292e2f3eb76aea7c282d2974a587cb29520ec90a (diff) | |
| download | rabbitmq-server-git-1ff50f4f37bf579a9b46990098236a16bb5dcb95.tar.gz | |
Change the semantics of Force to fit this particular bug. *meep*.
| -rw-r--r-- | src/rabbit_mnesia.erl | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index a662711687..0dc22914bf 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -505,22 +505,18 @@ init_db(ClusterNodes, Force) -> %% Take a cluster node config and create the right kind of node - a %% standalone disk node, or disk or ram node connected to the %% specified cluster nodes. If Force is false, don't allow -%% connections to offline nodes. +%% connections if all disc nodes are offline and we are a RAM node. init_db(ClusterNodes, Force, SecondaryPostMnesiaFun) -> UClusterNodes = lists:usort(ClusterNodes), ProperClusterNodes = UClusterNodes -- [node()], case mnesia:change_config(extra_db_nodes, ProperClusterNodes) of {ok, Nodes} -> - case Force of - false -> FailedClusterNodes = ProperClusterNodes -- Nodes, - case FailedClusterNodes of - [] -> ok; - _ -> throw({error, {failed_to_cluster_with, - FailedClusterNodes, - "Mnesia could not connect " - "to some nodes."}}) - end; - true -> ok + case Nodes =:= [] andalso not is_disc_node() andalso not Force of + false -> ok; + true -> throw({error, {failed_to_cluster_with, + ProperClusterNodes, + "Mnesia could not connect " + "to any disc nodes."}}) end, WantDiscNode = should_be_disc_node(ClusterNodes), WasDiscNode = is_disc_node(), |
