summaryrefslogtreecommitdiff
path: root/src/gm.erl
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-12-19 01:10:14 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2010-12-19 01:10:14 +0000
commitbad8e9b982703557f58b970e897645b6137e0e64 (patch)
tree43aa82c43a1ba386190ff68c7e3831653f683311 /src/gm.erl
parent7494ba44566e5b32a56c7b51f1bfce2f5acf8c56 (diff)
downloadrabbitmq-server-git-bad8e9b982703557f58b970e897645b6137e0e64.tar.gz
When you send a msg to another node, if the local node doesn't already have a connection to the destination node, it has to contact epmd and try and resolve the remote node. This takes time. Thus, in the event of a distributed gm group, it's very important that we record asap when a member dies as that member might be our downstream, to which we're sending, and it might be on another node. Thus promote the DOWN messages. Because of the inherent races going on, gm is built to cope with this anyway. This has the nice benefit that promotion of slaves to master in the event of failure of master is now pretty much instantaneous
Diffstat (limited to 'src/gm.erl')
-rw-r--r--src/gm.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gm.erl b/src/gm.erl
index 6a2c9c4876..baf46471c6 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -377,7 +377,7 @@
confirmed_broadcast/2, group_members/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
- code_change/3]).
+ code_change/3, prioritise_info/2]).
-export([behaviour_info/1]).
@@ -658,6 +658,10 @@ code_change(_OldVsn, State, _Extra) ->
{ok, State}.
+prioritise_info({'DOWN', _MRef, process, _Pid, _Reason}, _State) -> 1;
+prioritise_info(_ , _State) -> 0.
+
+
handle_msg(check_neighbours, State) ->
%% no-op - it's already been done by the calling handle_cast
{ok, State};