[erlang-questions] mnesia_loader overrun by mnesia_table_events

Ulf Wiger <>
Mon May 12 13:02:40 CEST 2008


One solution that comes to mind is to use transactions rather than dirty writes.

BR,
Ulf W

2008/5/12, Per Melin <>:
> 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
> terminates.
>
> 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
> memory.
>
> I understand that this is maybe an impossible situation. Or is there a
> solution?
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list