summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-10-20 21:00:13 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-10-20 21:00:13 +0100
commitb923fe09133960fa2b3223d5d457bcaf7f07c082 (patch)
treea1308f185c6ed0742630c8770b03f86fa6935bf6
parent22e54d371823e569b6b984b46597141b984d683e (diff)
parent5ad4e262115e0a5a7c85e040b3c8cc57aebc1f35 (diff)
downloadrabbitmq-server-b923fe09133960fa2b3223d5d457bcaf7f07c082.tar.gz
Merge bug26422
-rw-r--r--src/gm.erl8
-rw-r--r--src/rabbit_mirror_queue_slave.erl9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gm.erl b/src/gm.erl
index 6c09e664..636e63e4 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -720,6 +720,14 @@ handle_info({'DOWN', MRef, process, _Pid, Reason},
{_, {shutdown, ring_shutdown}} ->
noreply(State);
_ ->
+ %% In the event of a partial partition we could see another member
+ %% go down and then remove them from Mnesia. While they can
+ %% recover from this they'd have to restart the queue - not
+ %% ideal. So let's sleep here briefly just in case this was caused
+ %% by a partial partition; in which case by the time we record the
+ %% member death in Mnesia we will probably be in a full
+ %% partition and will not be assassinating another member.
+ timer:sleep(100),
View1 = group_to_view(record_dead_member_in_group(
Member, GroupName, TxnFun)),
handle_callback_result(
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 58fbcbe0..92e1cc27 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -317,6 +317,15 @@ handle_info({bump_credit, Msg}, State) ->
credit_flow:handle_bump_msg(Msg),
noreply(State);
+%% In the event of a short partition during sync we can detect the
+%% master's 'death', drop out of sync, and then receive sync messages
+%% which were still in flight. Ignore them.
+handle_info({sync_msg, _Ref, _Msg, _Props, _Unacked}, State) ->
+ noreply(State);
+
+handle_info({sync_complete, _Ref}, State) ->
+ noreply(State);
+
handle_info(Msg, State) ->
{stop, {unexpected_info, Msg}, State}.