[erlang-questions] mnesia and majority

Ulf Wiger <>
Thu Jul 12 20:27:18 CEST 2012


On 12 Jul 2012, at 20:07, Mike Oxford wrote:

> When facing a split with 'majority' enabled, you end up with a reduction in service based on the non-majority nodes.
> 
> If the interconnect-network is entirely down, then every node is non-majority and will 'freeze.'
> If the split is, say, 70/30, then the 30% will not update.
> 
> But then once the network is back up, does it automatically replay the missing transactions on the 30% from the 70%?  In a full-network-down situation where every node halts the write, when the network comes back up will everything re-mesh on its own?

Mnesia does no automatic merge. It can detect that a split has happened, and if you have 'majority' enabled, you can trust that you have avoided inconsistency, and can proceed to identify a majority island.

Mnesia doesn't give you much help with this, although you can spy into the "unsplit" code for _one_ way to do it. Another could be to have a "backdoor ping", e.g. via UDP, and -kernel dist_auto_connect false. This way, you can exchange information between "islands" and control when they are to reconnect.

The standard mnesia-supported way to resolve the situation would then be to restart the nodes in the minority island, after having called mnesia:set_master_nodes(Tables, MajorityNodes).

This has always been seen as something of a sledgehammer, but given that the minority nodes are not able to write to the database anyway, it is somewhat less so when combined with the 'majority' option. ;-)

> Or do I need something like Ulf's "unsplit" handlers?  Does mnesia still need to be patched to support "unsplit" or was that merged as well?

That patch was merged in R14B, I believe.

BR,
Ulf W

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120712/ad16fd78/attachment.html>


More information about the erlang-questions mailing list