[erlang-questions] gproc : 2 nodes out of sync behaviour.

Ulf Wiger ulf@REDACTED
Sun Jul 1 13:49:02 CEST 2012


It's a feature of gproc, carefully crafted to make life more interesting. ;-)

There is no resynch after netsplit in gproc, since gen_leader didn't use to have a way to handle netsplits. Still, there is no hook to inform the callback (gproc_dist) about what's happened.

One way to deal with this, is to set -kernel dist_auto_connect false, and add a "backdoor ping" (e.g. over UDP). If you get a ping from a known node that's not in the nodes() list, you have a netsplit situation. You can then select which node(s) to restart. After restart, normal synch will ensue, and since the nodes never auto-connected, you will have concistency (but quite possibly data loss, of course).

BR,
Ulf W

Ulf Wiger, Feuerlabs, Inc.
http://www.feuerlabs.com

1 jul 2012 kl. 13:36 skrev Morgan Segalis <msegalis@REDACTED>:

> Hello everyone,
> 
> I have 2 nodes which use gproc.
> Both are well connected to each other…
> But sometimes (doesn't happen really often, but it does) both server gets disconnected to each other, once their are connected again, gproc is out of sync.
> 
> Here's what happen : 
> 1- A is connected to B.
> 2- a new value X set by A is saw by B
> 3- a new value Y set by B is saw by A
> -------- they get disconnect for a second or two --------
> 4- Clusters lost connection
> -------- they reconnect ----------
> 5- Clusters regain connection
> 6- the old value X set by A is not saw anymore by B
> 7- the old value Y set by B is not saw anymore by B
> 8- a new value Z set by A is saw by B
> 9- a new value V set by B is not saw by A
> 
> how come in "8" the new value Z set by A is saw by B and in "9" a new value V set by B is not saw by A ?
> I know that there is a leader, which is probably B, but I can't explain why new value are not seen symmetrically.
> what should I do for reconnecting correctly both cluster, so old value and new value are saw in both cluster again ?
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list