summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-10-02 13:51:52 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-10-02 13:51:52 +0100
commit3e79a2cf23e145de7768ef1544b7e55bfa90f971 (patch)
treefc355890f95113fe209b4cf5c00f7ed2b497359b
parentbde9f8d0642b4b9b2cc46ce523d9fba412c98e99 (diff)
downloadrabbitmq-server-bug25184.tar.gz
comments, also wait for tables right after you load thembug25184
-rw-r--r--src/rabbit_mnesia.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index c0321299..87069228 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -276,6 +276,9 @@ forget_cluster_node(Node, RemoveWhenOffline) ->
end.
remove_node_offline_node(Node) ->
+ %% We want the running nodes *now*, so we don't call
+ %% `cluster_nodes(running)' which will just get what's in the cluster status
+ %% file.
case {running_nodes(cluster_nodes(all)) -- [Node], node_type()} of
{[], disc} ->
%% Note that while we check if the nodes was the last to
@@ -289,9 +292,13 @@ remove_node_offline_node(Node) ->
case cluster_nodes(running) -- [node(), Node] of
[] -> start_mnesia(),
try
+ %% What we want to do here is replace the last node to
+ %% go down with the current node. The way we do this
+ %% is by force loading the table, and making sure that
+ %% they are loaded.
rabbit_table:force_load(),
- forget_cluster_node(Node, false),
- rabbit_table:wait_for_replicated()
+ rabbit_table:wait_for_replicated(),
+ forget_cluster_node(Node, false)
after
stop_mnesia()
end;