Deleting mnesia tables

Sean Hinde Sean.Hinde@REDACTED
Fri Sep 6 18:16:00 CEST 2002


> >
> >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.
> 
> But isn't mnesia:set_master_nodes(Tab, OtherNodes) what you're
> really looking for?
> 
> It will force mnesia on the node where the call is made to
> unconditionally load Tab from one of the given nodes. The
> function can be called before mnesia is started.

It was a slightly unusual situation. We had a table mirrored across two
nodes of a 24 node system. One of these nodes was rebuilt from scratch with
a newly spliced in schema not including this table.

At some point in the past set_master_nodes had been run to set the now
'orphan' copy as the master.

The new node crashed (reason unknown) but then would not start correctly
because of an {undefined, 'orphan_table'} type error.

obviously I couldn't delete the 'orphan' because the other node wasn't
started - catch 22.

I tried setting master nodes for this table to [] but it didn't help.

I do not understand quite how, but following Hakan's procedure worked
spectatcularly well.

1. mnesia:del_table_copy(schema, other@REDACTED). worked

2. mnesia:delete_table(t). worked

I then started mnesia on other@REDACTED and it came up straight away fully
integrated into the schema with all it's tables intact. It was just as
through I had never deleted it's schema from the other nodes at all.

Quite a relief, but I've no idea quite why it worked..?

Sean



NOTICE AND DISCLAIMER:
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