diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-10-24 15:18:48 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-10-24 15:18:48 +0100 |
| commit | 02877b21dfbc818e90f1a970d2fa5c451a420f6c (patch) | |
| tree | 277c273327a47d956b12cd35904c1b49f59d3ffb | |
| parent | bc506928f65ac4a70c84b95068679f1b3f1e718f (diff) | |
| download | rabbitmq-server-git-02877b21dfbc818e90f1a970d2fa5c451a420f6c.tar.gz | |
post merge cleanup
| -rw-r--r-- | src/rabbit_mnesia.erl | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 6df0367f43..db4c58caa2 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -338,27 +338,6 @@ is_clustered() -> AllNodes = cluster_nodes(all), cluster_nodes(WhichNodes) -> cluster_status(WhichNodes). -cluster_status(WhichNodes) -> - {AllNodes, DiscNodes, RunningNodes} = Nodes = - case cluster_status_from_mnesia() of - {ok, Nodes0} -> - Nodes0; - {error, _Reason} -> - {AllNodes0, DiscNodes0, RunningNodes0} = - rabbit_node_monitor:read_cluster_status(), - %% The cluster status file records the status when the node is - %% online, but we know for sure that the node is offline now, so - %% we can remove it from the list of running nodes. - {AllNodes0, DiscNodes0, nodes_excl_me(RunningNodes0)} - end, - case WhichNodes of - status -> Nodes; - all -> AllNodes; - disc -> DiscNodes; - ram -> AllNodes -- DiscNodes; - running -> RunningNodes - end. - %% This function is the actual source of information, since it gets %% the data from mnesia. Obviously it'll work only when mnesia is %% running. @@ -390,6 +369,27 @@ cluster_status_from_mnesia() -> end end. +cluster_status(WhichNodes) -> + {AllNodes, DiscNodes, RunningNodes} = Nodes = + case cluster_status_from_mnesia() of + {ok, Nodes0} -> + Nodes0; + {error, _Reason} -> + {AllNodes0, DiscNodes0, RunningNodes0} = + rabbit_node_monitor:read_cluster_status(), + %% The cluster status file records the status when the node is + %% online, but we know for sure that the node is offline now, so + %% we can remove it from the list of running nodes. + {AllNodes0, DiscNodes0, nodes_excl_me(RunningNodes0)} + end, + case WhichNodes of + status -> Nodes; + all -> AllNodes; + disc -> DiscNodes; + ram -> AllNodes -- DiscNodes; + running -> RunningNodes + end. + node_info() -> {erlang:system_info(otp_release), rabbit_misc:version(), cluster_status_from_mnesia()}. @@ -720,7 +720,6 @@ change_extra_db_nodes(ClusterNodes0, CheckOtherNodes) -> Nodes end. -%% when mnesia is stopped is_running_remote() -> {mnesia:system_info(is_running) =:= yes, node()}. check_consistency(OTP, Rabbit) -> |
