summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2016-10-26 16:14:13 +0300
committerGitHub <noreply@github.com>2016-10-26 16:14:13 +0300
commit47916838a759be87efe3acf2db910600f51603d8 (patch)
treebc6c6a6f830b1f0a76ba5a2589cd4487921048b0 /src
parentd36b6391d04de5120418368e621dc12f97cc4012 (diff)
parent0cd55eb2b1d8b3e482bb19d85d304acb26b18304 (diff)
downloadrabbitmq-server-git-47916838a759be87efe3acf2db910600f51603d8.tar.gz
Merge pull request #1009 from rabbitmq/rabbitmq-server-1006
Stop master in receiving sync_start from another master after partition
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 3111afca2e..bfa868c651 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -1300,7 +1300,13 @@ handle_cast(policy_changed, State = #q{q = #amqqueue{name = Name}}) ->
%% This also has the side effect of waking us up so we emit a
%% stats event - so event consumers see the changed policy.
{ok, Q} = rabbit_amqqueue:lookup(Name),
- noreply(process_args_policy(State#q{q = Q})).
+ noreply(process_args_policy(State#q{q = Q}));
+
+handle_cast({sync_start, _, _}, State = #q{q = #amqqueue{name = Name}}) ->
+ %% Only a slave should receive this, it means we are a duplicated master
+ rabbit_mirror_queue_misc:log_warning(
+ Name, "Stopping after receiving sync_start from another master", []),
+ stop(State).
handle_info({maybe_expire, Vsn}, State = #q{args_policy_version = Vsn}) ->
case is_unused(State) of