summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2015-03-06 13:51:39 +0000
committerSimon MacMullen <simon@rabbitmq.com>2015-03-06 13:51:39 +0000
commitd538f7d95646a7a9527c9f05ee274768a758a266 (patch)
tree5bd11df7ca9f2d3b5322228fedb3deb6db7e033f /src
parente16cac646b613c1cf01827c6aba4c5c031d83eee (diff)
parent60821729247e6fe6ac66fdeec88a7d188de0d6e9 (diff)
downloadrabbitmq-server-git-d538f7d95646a7a9527c9f05ee274768a758a266.tar.gz
Merge branch 'bug26633'
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_node_monitor.erl18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/rabbit_node_monitor.erl b/src/rabbit_node_monitor.erl
index 239f6b5deb..94a95deb0d 100644
--- a/src/rabbit_node_monitor.erl
+++ b/src/rabbit_node_monitor.erl
@@ -446,12 +446,22 @@ handle_cast({partial_partition, NotReallyDown, Proxy, MyGUID},
ArgsBase),
await_cluster_recovery(fun all_nodes_up/0),
{noreply, State};
+ {ok, {pause_if_all_down, PreferredNodes, _}} ->
+ case in_preferred_partition(PreferredNodes) of
+ true -> rabbit_log:error(
+ FmtBase ++ "We will therefore intentionally "
+ "disconnect from ~s~n", ArgsBase ++ [Proxy]),
+ upgrade_to_full_partition(Proxy);
+ false -> rabbit_log:info(
+ FmtBase ++ "We are about to pause, no need "
+ "for further actions~n", ArgsBase)
+ end,
+ {noreply, State};
{ok, _} ->
rabbit_log:error(
FmtBase ++ "We will therefore intentionally disconnect from ~s~n",
ArgsBase ++ [Proxy]),
- cast(Proxy, {partial_partition_disconnect, node()}),
- disconnect(Proxy),
+ upgrade_to_full_partition(Proxy),
{noreply, State}
end;
@@ -783,6 +793,10 @@ del_node(Node, Nodes) -> Nodes -- [Node].
cast(Node, Msg) -> gen_server:cast({?SERVER, Node}, Msg).
+upgrade_to_full_partition(Proxy) ->
+ cast(Proxy, {partial_partition_disconnect, node()}),
+ disconnect(Proxy).
+
%% When we call this, it's because we want to force Mnesia to detect a
%% partition. But if we just disconnect_node/1 then Mnesia won't
%% detect a very short partition. So we want to force a slightly