Re: Mnesia files

Mikael Pettersson <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAM43=SOGyYa-2gTTocL9_2yHuyKL4z8UnwkNdzB=GGPj+MtXrA@mail.gmail.com>
On Wed, Apr 14, 2021 at 6:46 PM Frank Muller <[email protected]> wrote:
>
> Hi Mnesia users/experts,
>
> Could someone pls explain me the roles of these files: LATEST.LOG, DAT, DCT and DCL?

DCT? Did you mean DCD?

> Read the doc multiple times but couldn’t fully grasp their roles:
> https://erlang.org/doc/apps/mnesia/Mnesia_chap7.html#log-file
>
> What are they for?

DCD and DCL files represent disc_copies tables. The DCD is an image of
the contents from the latest time the table was "dumped", while the
DCL contains a log of the side-effects made to that table since it was
dumped. A dump creates a new DCD and removes the DCL.

DAT files are DETS:es which contain disc_only_copies tables.

SCHEMA.DAT is a special DETS that contains the schema for that Mnesia instance.

LATEST.LOG is Mnesia's transaction log, which is periodically flushed
to the updated tables.

> What happens if in the middle of many transactions I unplug the electrical cable, put it back and restart Mnesia. How these files will help to recover the state.

See above.

> Finally which ones are important to keep and which aren’t?

They are all important.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.