diff options
author | Ulf Wiger <[email protected]> | 2013-11-20 18:21:44 +0100 |
---|---|---|
committer | Richard Carlsson <[email protected]> | 2014-12-22 22:43:16 +0100 |
commit | 85112014bd136055b56e6ec5218f82f74951e0c6 (patch) | |
tree | edd417722a7f48a0a1dc1a2d5cd360b1e3f997e3 /lib/mnesia/src/mnesia_loader.erl | |
parent | 07b8f441ca711f9812fad9e9115bab3c3aa92f79 (diff) | |
download | otp-85112014bd136055b56e6ec5218f82f74951e0c6.tar.gz otp-85112014bd136055b56e6ec5218f82f74951e0c6.tar.bz2 otp-85112014bd136055b56e6ec5218f82f74951e0c6.zip |
Make Mnesia DCD dump behaviour available via configuration
Setting the new Mnesia parameter 'dump_disc_copies_at_startup' to
'false' will completely disable the DCD dumping while tables are being
loaded. If it is set to 'true' (the default), the same test will now
be performed as for normal dumps, i.e., using the 'dc_dump_limit'
parameter. Previously, the test performed at load time was different
from the one used at runtime, and caused a lot of unnecessary dumping
which slowed down the startup.
Diffstat (limited to 'lib/mnesia/src/mnesia_loader.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_loader.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/mnesia/src/mnesia_loader.erl b/lib/mnesia/src/mnesia_loader.erl index 4afbea1cc2..ebd68c226a 100644 --- a/lib/mnesia/src/mnesia_loader.erl +++ b/lib/mnesia/src/mnesia_loader.erl @@ -69,9 +69,10 @@ do_get_disc_copy2(Tab, Reason, Storage, Type) when Storage == disc_copies -> ignore; _ -> mnesia_monitor:mktab(Tab, Args), - Count = mnesia_log:dcd2ets(Tab, Repair), - case ets:info(Tab, size) of - X when X < Count * 4 -> + _Count = mnesia_log:dcd2ets(Tab, Repair), + case mnesia_monitor:get_env(dump_disc_copies_at_startup) + andalso mnesia_dumper:needs_dump_ets(Tab) of + true -> ok = mnesia_log:ets2dcd(Tab); _ -> ignore |