summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Powell <steve@rabbitmq.com>2012-02-22 14:44:20 +0000
committerSteve Powell <steve@rabbitmq.com>2012-02-22 14:44:20 +0000
commit12fcf5e1be40cb77dbabee1f827a50c84dd7b37b (patch)
tree42da67f315d27a6729c6aa02f7d0b84609c5669e
parentd007ae49c8964a362b915eb8ddeb0b202c1ada32 (diff)
parent8122d48a62f04d76d4beba90c099fb02ebd5dc68 (diff)
downloadrabbitmq-server-12fcf5e1be40cb77dbabee1f827a50c84dd7b37b.tar.gz
Merge default in
-rw-r--r--Makefile2
-rw-r--r--packaging/windows/Makefile5
-rw-r--r--src/rabbit_mnesia.erl10
-rw-r--r--src/rabbit_tests.erl15
4 files changed, 26 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index eda5babb..19954de8 100644
--- a/Makefile
+++ b/Makefile
@@ -350,7 +350,7 @@ $(foreach XML,$(USAGES_XML),$(eval $(call usage_dep, $(XML))))
# automatic dependency generation for that target (e.g. cleandb).
# We want to load the dep file if *any* target *doesn't* contain
-# "clean" - i.e. if removing all clean-like targets leaves something
+# "clean" - i.e. if removing all clean-like targets leaves something.
ifeq "$(MAKECMDGOALS)" ""
TESTABLEGOALS:=$(.DEFAULT_GOAL)
diff --git a/packaging/windows/Makefile b/packaging/windows/Makefile
index 8e0ab074..a910941b 100644
--- a/packaging/windows/Makefile
+++ b/packaging/windows/Makefile
@@ -25,7 +25,10 @@ dist:
xmlto -o . xhtml-nochunks ../../docs/rabbitmq-service.xml
elinks -dump -no-references -no-numbering rabbitmq-service.html \
> $(TARGET_DIR)/readme-service.txt
- todos $(TARGET_DIR)/readme-service.txt || unix2dos $(TARGET_DIR)/readme-service.txt
+ todos $(TARGET_DIR)/readme-service.txt
+ todos $(TARGET_DIR)/INSTALL
+ todos $(TARGET_DIR)/LICENSE*
+ todos $(TARGET_DIR)/plugins/README.txt
rm -rf $(TARGET_DIR)/plugins-src
zip -q -r $(TARGET_ZIP).zip $(TARGET_DIR)
rm -rf $(TARGET_DIR) rabbitmq-service.html
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 60dd0770..4d419fd9 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -732,18 +732,18 @@ reset(Force) ->
false -> ok
end,
Node = node(),
+ Nodes = all_clustered_nodes() -- [Node],
case Force of
true -> ok;
false ->
ensure_mnesia_dir(),
start_mnesia(),
- {Nodes, RunningNodes} =
+ RunningNodes =
try
%% Force=true here so that reset still works when clustered
%% with a node which is down
ok = init_db(read_cluster_nodes_config(), true),
- {all_clustered_nodes() -- [Node],
- running_clustered_nodes() -- [Node]}
+ running_clustered_nodes() -- [Node]
after
stop_mnesia()
end,
@@ -751,6 +751,10 @@ reset(Force) ->
rabbit_misc:ensure_ok(mnesia:delete_schema([Node]),
cannot_delete_schema)
end,
+ %% We need to make sure that we don't end up in a distributed
+ %% Erlang system with nodes while not being in an Mnesia cluster
+ %% with them. We don't handle that well.
+ [erlang:disconnect_node(N) || N <- Nodes],
ok = delete_cluster_nodes_config(),
%% remove persisted messages and any other garbage we find
ok = rabbit_file:recursive_delete(filelib:wildcard(dir() ++ "/*")),
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 7a96af26..433ed9cb 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -71,10 +71,13 @@ maybe_run_cluster_dependent_tests() ->
run_cluster_dependent_tests(SecondaryNode) ->
SecondaryNodeS = atom_to_list(SecondaryNode),
+ cover:stop(SecondaryNode),
ok = control_action(stop_app, []),
ok = control_action(reset, []),
ok = control_action(cluster, [SecondaryNodeS]),
ok = control_action(start_app, []),
+ cover:start(SecondaryNode),
+ ok = control_action(start_app, SecondaryNode, [], []),
io:format("Running cluster dependent tests with node ~p~n", [SecondaryNode]),
passed = test_delegates_async(SecondaryNode),
@@ -960,7 +963,9 @@ test_cluster_management2(SecondaryNode) ->
ok = control_action(cluster, [SecondaryNodeS, NodeS]),
ok = control_action(start_app, []),
ok = control_action(stop_app, []),
+ cover:stop(SecondaryNode),
ok = control_action(reset, []),
+ cover:start(SecondaryNode),
%% attempt to leave cluster when no other node is alive
ok = control_action(cluster, [SecondaryNodeS, NodeS]),
@@ -977,7 +982,15 @@ test_cluster_management2(SecondaryNode) ->
%% leave system clustered, with the secondary node as a ram node
ok = control_action(force_reset, []),
ok = control_action(start_app, []),
- ok = control_action(force_reset, SecondaryNode, [], []),
+ %% Yes, this is rather ugly. But since we're a clustered Mnesia
+ %% node and we're telling another clustered node to reset itself,
+ %% we will get disconnected half way through causing a
+ %% badrpc. This never happens in real life since rabbitmqctl is
+ %% not a clustered Mnesia node.
+ cover:stop(SecondaryNode),
+ {badrpc, nodedown} = control_action(force_reset, SecondaryNode, [], []),
+ pong = net_adm:ping(SecondaryNode),
+ cover:start(SecondaryNode),
ok = control_action(cluster, SecondaryNode, [NodeS], []),
ok = control_action(start_app, SecondaryNode, [], []),