Deleting mnesia tables

Sean Hinde Sean.Hinde@REDACTED
Fri Sep 6 15:41:16 CEST 2002

> Sean> Anyone know an easy way to delete a table which one 
> node thinks exists both
> Sean> on itself and on another node, while the other node is 
> down (please don't
> Sean> ask!)?
> You need to remove the other node from the schema before you 
> can delete the table:
>    (one@REDACTED)8> mnesia:create_table(t, [{disc_copies, 
> [one@REDACTED, other@REDACTED]}]).
>    {atomic,ok}
>    (one@REDACTED)9> rpc:call(other@REDACTED, mnesia, stop, []). 
>    stopped
>    (one@REDACTED)10> mnesia:delete_table(t).
>    {aborted,{not_active,"All replicas on diskfull nodes are 
> not active yet",
> 			t,
> 			[other@REDACTED]}}
>    (one@REDACTED)11> mnesia:del_table_copy(schema, 
> other@REDACTED).
>    {atomic,ok}
>    (one@REDACTED)12> mnesia:delete_table(t).                
>    {atomic,ok}
>    (one@REDACTED)13> 

Thanks, Trouble is there are loads of tables on the other node and It is a
lot of work to re-build it all again from the replica.

I've thought over lunch and concluded that mnesia needs a "more rope" mode.
It is good at trying to prevent dumb users from creating a network of
inconsistent schemas, but not quite good enough (e.g. manually upgrade one
node leaving cruft behind on another).

The trouble is that once a live system is inconsistent it is nigh on
impossible to repair it without a major rebuild of at least one node.

I would be interested to see some functions along the lines of:


and such like.

Meanwhile I'm fiddling with dets (but the support guys will want us to do
the job properly..)


This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.

More information about the erlang-questions mailing list