diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2016-10-25 13:44:55 +0100 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2016-10-25 13:44:55 +0100 |
| commit | 0cd55eb2b1d8b3e482bb19d85d304acb26b18304 (patch) | |
| tree | 026dd65987e17474a673d20b964299eb603aa734 /src | |
| parent | 3906b1bfd21c83ba33ef5de491a993f8d4d9fc03 (diff) | |
| download | rabbitmq-server-git-0cd55eb2b1d8b3e482bb19d85d304acb26b18304.tar.gz | |
Stop master in receiving sync_start from another master after partition
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 8 |
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 |
