summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-05-29 12:13:27 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-05-29 12:13:27 +0100
commit9d929da847c44c1f37a3b8c773aeed63c46fd4f8 (patch)
tree42267ae3287a88fe4b097b48c8559f16b7de9476
parente48ec9be9b6d7f7a84e05955914c91f60ec5ae67 (diff)
downloadrabbitmq-server-bug26210.tar.gz
Don't prioritise DOWNs from the left. Also explain why we prioritise in various ways.bug26210
-rw-r--r--src/gm.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gm.erl b/src/gm.erl
index fb59b9cb..7a2f5835 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -732,8 +732,21 @@ code_change(_OldVsn, State, _Extra) ->
prioritise_info(flush, _Len, _State) ->
1;
+%% DOWN messages should not overtake initial catchups; if they do we
+%% will receive a DOWN we do not know what to do with.
prioritise_info({'DOWN', _MRef, process, _Pid, _Reason}, _Len,
- #state { members_state = MS }) when MS /= undefined ->
+ #state { members_state = undefined }) ->
+ 0;
+%% We should not prioritise DOWN messages from our left since
+%% otherwise the DOWN can overtake any last activity from the left,
+%% causing that activity to be lost.
+prioritise_info({'DOWN', _MRef, process, LeftPid, _Reason}, _Len,
+ #state { left = {{_LeftVer, LeftPid}, _MRef2} }) ->
+ 0;
+%% But prioritise all other DOWNs - we want to make sure we are not
+%% sending activity into the void for too long because our right is
+%% down but we don't know it.
+prioritise_info({'DOWN', MRef, process, Pid, _Reason}, _Len, _State) ->
1;
prioritise_info(_, _Len, _State) ->
0.