What is the best way to detect the conflict of mnesia schemas?

Sergey Samokhin prikrutil@REDACTED
Wed Jun 10 00:18:32 CEST 2009


I should have made sure that mnesia:change_config(extra_db_nodes,
[Node]) doesn't return error tuple before sending that message.
Actually it does return {error, {merge_schema_failed,
DetailedDescription}} tuple, which can be used to detect this kind of

So there are only two questions I'm trying to find answers to:

1) Is it right, that I should not use set_env() to change the value of
dist_auto_connect on the fly?

2) Is it right that there is no way in general to figure out that
mnesia:start() failed because nodes the schema-on-disk knows about are
no longer belongs to the same mnesia-cluster. Currently I start mnesia
by the following function:

start_mnesia() ->
    case mnesia:start() of
        {error, {shutdown, {mnesia_sup,start, [normal, []]}}} ->
            % write to log
	    exit("Schema seems to be ambiguous");
        ok ->

Is there a better way to catch this error?

Sergey Samokhin

More information about the erlang-questions mailing list