[erlang-questions] RFC: mnesia majority checking
Ulf Wiger
ulf.wiger@REDACTED
Sat Dec 11 12:26:38 CET 2010
Hi Joe,
I don't know why it wasn't present from the start. I'd imagine it wasn't
a conscious decision.
Regarding schema operations, all the _affected_ schema nodes must
be up, I believe. For example, if you create a table with copies on N1
and N2, both N1 and N2 must be available during the schema operation.
OTOH, this worked:
- start mnesia on N1 with a disk schema
- start N2 with {extra_db_nodes,[N1]}
- run mnesia:change_table_copy_type(schema,N2,disc_copies)
- start N3 the same way
- kill N1
- change N3's schema to disc_copies
And after this, I was able to add a replica for a table on N3, even
though it had a replica on N1 and N1 was down. So it is not
entirely clear under which conditions mnesia decides to be conservative
about schema changes, and why.
(BTW, once I started N1 again, mnesia dumped core due to a combine
error, so it would seem as if some conservatism is well warranted. :)
I can't say I know what issues would arise if one would introduce a
majority condition for the schema. It doesn't quite play by the same rules
as user-defined tables.
BR,
Ulf
On 11 Dec 2010, at 11:32, Joseph Wayne Norton wrote:
> Ulf -
>
> I think this majority checking feature is a good feature for Mnesia. Are you aware of any reasons why this feature wasn't present from Mnesia's beginning?
>
> I'd also like to confirm my understanding of your comment below. For schema updates, my understanding is that all nodes having a copy of the table definition must be available. Would it be possible and/or desirable to support a majority checking feature for schema updates too?
>
> thanks,
>
> On 2010/12/10, at 16:44, Ulf Wiger wrote:
>
>> Really, I didn't invent this protocol, and I've taken great care not
>> to alter it, as I've assumed it is robust. It's been in mnesia for years.
>> It's the same protocol that's used for schema updates in mnesia,
>> more heavyweight and pessimistic than the 'normal' commit
>> protocol. If you wish to dissect the asym_trans protocol looking for
>> nasty corner cases, I think it's great, but then perhaps one of the
>> mnesia maintainers, Dan and Håkan (still counting Håkan as such)
>> should join the discussion.
>
> Joseph Wayne Norton
> norton@REDACTED
>
>
>
Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com
More information about the erlang-questions
mailing list