[erlang-questions] MNESIA FRAGMENTATION AND REPLICATION

Ulf Wiger <>
Mon Oct 10 14:30:39 CEST 2011


On 10 Oct 2011, at 14:08, Joshua Muzaaya wrote:

> Questions:
> 1. What would a Database administrator do if mnesia generates events of inconsistent_database, starting to run database behind a partitioned network, in a situation where setting amnesia master node is not desirable (for fear of data loss) ? 

Take a look at http://github.com/esl/unsplit

It was designed to help resolve netsplits.

> 2. What is the consequence of the mnesia event inconsistent_database, starting to run database behind a partitioned network as regards my application ? What if i do not react to this event and let things continue the way they are ? am i loosing data ? 

The event basically means that the returning node did not synch its tables with the running cluster. Something needs to be done at this point. The unsplit application triggers on the 'inconsistent_database' event and performs an automatic merge. Note that you have to plan your database in order to make such a merge possible.

> 3. In large mnesia clusters, what can one do if Mnesia goes down together with the Erlang VM on a remote site ? are there any known good methods of automatically handling this situation ? 

From a mnesia/erlang point of view, this is the same as when a local node dies. Could you clarify the question, please?


> 4. There times when one or two nodes are unreachable due to network problems or failures, and mnesia on the surviving Node reports that a given file does not exist especially in cases where you have indexes. So at run time, what would be the behavior of my application if some replicas go down. Would you advise me to have a master node within a mnesia cluster ? 

When dealing with fragmentation in mnesia, you may want to take control over the allocation of fragments to nodes. While mnesia offers to do this automatically, you can be explicit about the location of fragments, and you can also move them around.

The automatic indexing is problematic with fragmented tables. It's better to create your own 'index', using a second mnesia table.

BR,
Ulf W

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com



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


More information about the erlang-questions mailing list