Mnesia - mnesia_subscr and force_load_table

Serge Aleynikov <>
Mon Aug 29 13:21:12 CEST 2005

I wonder if there's a mnesia equivalent to the Oracle's SCN (System 
Change Number), which is the number that gets incremented every time 
there's a modification in the database.  This could be very helpful if 
you know you have a partitioned network, and need to decide which 
database has the most current data.  If would be even more helpful if 
there were such an SCN per mnesia table.

Also, how do you determine if a restart is due to paritioned network 
(this might require some persistence of state between restarts).


> In AXD 301, I wrote a set of programs to monitor mnesia's
> boot process:
> - One part that started before mnesia (this can be done
>   by sorting the list of applications in the .rel file
>   -- as long as the order doesn't violate application
>   dependencies, it will be kept.) This application would
>   check whether the restart was due to partitioned network
>   and make sure that master_nodes were set accordingly.
> - One part that started right after mnesia, and called
>   mnesia:wait_for_tables(AllMyTabs, Timeout). After Timeout,
>   a loop analysis was performed in a wait-for graph. This
>   graph was built using a hello protocol between the waiters
>   on all nodes. If no cyclical wait was detected, another
>   call to wait_for_tables/2 was made, and so on. If, at
>   the point of timeout, there are no other waiters, the
>   tables are loaded by force.
> I once tried to get a research project started to try to
> assess the correctness of the algorithm and the code, but
> this fell through. One of the questions I also wanted answered
> was "what additional information is needed from mnesia in
> order to make this easier?", because it does feel as if
> mnesia doesn't help as much as it could.
> I can't give more details about the solution, since I don't
> have it available, and it's been years since I last looked
> at it. Given its operational track record, at least the code
> isn't obviously broken, though.  (:
> /Uffe

More information about the erlang-questions mailing list