[erlang-questions] mnesia_loader overrun by mnesia_table_events

Per Melin <>
Mon May 12 12:42:46 CEST 2008

I have a ram_copies table on node A and node B. It has ~900K records
and takes up ~900MB.

If I take down node B and then bring it back up it copies the table
from A very fast.

The problem is that during normal operations I do 5K-10K dirty writes
per second on node A. And under those conditions the copying never

What happens, as far as I can tell, is that
mnesia_loader:spawned_receiver/8 calls ets:init_table/2, and by the
time it has copied some 300K records it has also received about 100K
of {mnesia_table_event, {write, ..., {dirty, ...}}} which builds up in
the inbox because they are not being taken care of yet. Now things
start to go slower and slower for init_table. Eventually there are
millions of table events in the inbox and the server runs out of

I understand that this is maybe an impossible situation. Or is there a solution?

More information about the erlang-questions mailing list