diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-19 01:10:14 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-19 01:10:14 +0000 |
| commit | bad8e9b982703557f58b970e897645b6137e0e64 (patch) | |
| tree | 43aa82c43a1ba386190ff68c7e3831653f683311 /src/gm.erl | |
| parent | 7494ba44566e5b32a56c7b51f1bfce2f5acf8c56 (diff) | |
| download | rabbitmq-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.erl | 6 |
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}; |
