summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-09-11 18:56:13 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-09-11 18:56:13 +0100
commitc744654c7db8426329c9f75ec9527431e01862bc (patch)
tree7f8bd4bceca2d450a95b7409402608a0804f1178
parent2c84bf988c1a842aca763b4bcff6ff9aed5aaab4 (diff)
downloadrabbitmq-server-c744654c7db8426329c9f75ec9527431e01862bc.tar.gz
do not give up when finding an inconsistent node
-rw-r--r--src/rabbit_mnesia.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 31672512..aaff219b 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -705,9 +705,10 @@ wait_for_tables(TableNames) ->
check_cluster_consistency() ->
%% We want to find 0 or 1 consistent nodes.
case lists:foldl(
- fun (Node, not_found) -> check_cluster_consistency(Node);
+ fun (Node, {error, _}) -> check_cluster_consistency(Node);
(_Node, {ok, Status}) -> {ok, Status}
- end, not_found, ordsets:del_element(node(), all_clustered_nodes()))
+ end, {error, not_found},
+ ordsets:del_element(node(), all_clustered_nodes()))
of
{ok, Status = {RemoteAllNodes, _, _}} ->
case ordsets:is_subset(all_clustered_nodes(), RemoteAllNodes) of
@@ -725,19 +726,21 @@ check_cluster_consistency() ->
mnesia:delete_schema([node()])
end,
rabbit_node_monitor:write_cluster_status(Status);
- not_found ->
- ok
+ {error, not_found} ->
+ ok;
+ E = {error, _} ->
+ throw(E)
end.
check_cluster_consistency(Node) ->
case rpc:call(Node, rabbit_mnesia, node_info, []) of
{badrpc, _Reason} ->
- not_found;
+ {error, not_found};
{_OTP, _Rabbit, {error, _}} ->
- not_found;
+ {error, not_found};
{OTP, Rabbit, {ok, Status}} ->
case check_consistency(OTP, Rabbit, Node, Status) of
- {error, Error} -> throw({error, Error});
+ E = {error, _} -> E;
{ok, Res} -> {ok, Res}
end
end.