summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-09-19 13:01:36 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-09-19 13:01:36 +0100
commit4c3f9bdf2d7446a91255070f1020a2f4e1eb5b9c (patch)
tree95a9bb1f2abd38bd695408e9dcdba9301945f5c4
parent854665a81c5b0eca2e7934a726bb9293a84d1174 (diff)
downloadrabbitmq-server-4c3f9bdf2d7446a91255070f1020a2f4e1eb5b9c.tar.gz
fix `rabbit_mnesia:is_virgin_node/0', was checking only for one status file
-rw-r--r--Makefile2
-rw-r--r--src/rabbit_mnesia.erl13
2 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index f3729cfa..c63e3dfd 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,7 @@ $(SOURCE_DIR)/rabbit_framing_amqp_0_8.erl: codegen.py $(AMQP_CODEGEN_DIR)/amqp_c
dialyze: $(BEAM_TARGETS) $(BASIC_PLT)
dialyzer --plt $(BASIC_PLT) --no_native --fullpath \
- -Wrace_conditions $(BEAM_TARGETS)
+ $(BEAM_TARGETS)
# rabbit.plt is used by rabbitmq-erlang-client's dialyze make target
create-plt: $(RABBIT_PLT)
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index f19046a0..611f7dda 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -1106,16 +1106,17 @@ check_rabbit_consistency(Remote) ->
%% mnesia tables aren't there because restarted RAM nodes won't have
%% tables while still being non-virgin. What we do instead is to
%% check if the mnesia directory is non existant or empty, with the
-%% exception of the cluster status file, which will be there thanks to
+%% exception of the cluster status files, which will be there thanks to
%% `rabbit_node_monitor:prepare_cluster_status_file/0'.
is_virgin_node() ->
case rabbit_file:list_dir(dir()) of
{error, enoent} -> true;
- {ok, []} -> true;
- {ok, [File]} -> (dir() ++ "/" ++ File) =:=
- [rabbit_node_monitor:cluster_status_filename(),
- rabbit_node_monitor:running_nodes_filename()];
- {ok, _} -> false
+ {ok, []} -> true;
+ {ok, [File1, File2]} ->
+ lists:usort([dir() ++ "/" ++ File1, dir() ++ "/" ++ File2]) =:=
+ lists:usort([rabbit_node_monitor:cluster_status_filename(),
+ rabbit_node_monitor:running_nodes_filename()]);
+ {ok, _} -> false
end.
find_good_node([]) ->