diff options
author | Dan Gudmundsson <[email protected]> | 2016-01-19 16:08:08 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-05-09 14:55:36 +0200 |
commit | 545d88ac5b1a6bb6fe219c3175e1cafd716f1581 (patch) | |
tree | 787d071a3f0d3645aa544abb3ade071281efc762 /lib/mnesia/src/mnesia_dumper.erl | |
parent | 3aff6476811a385cf45817d6974b83a6b0345a92 (diff) | |
download | otp-545d88ac5b1a6bb6fe219c3175e1cafd716f1581.tar.gz otp-545d88ac5b1a6bb6fe219c3175e1cafd716f1581.tar.bz2 otp-545d88ac5b1a6bb6fe219c3175e1cafd716f1581.zip |
mnesia_ext: Create table/data containers from mnesia monitor not temporary processes
Tables or data containers should be owned and monitored by mnesia_monitor and
should thus be created by that process.
Always create_table before loading it
We need to create tables for ram_copies at least before loading
them as they are intermittent. It is also needed to get mnesia
monitor as the parent and supervisor of the data storage.
Diffstat (limited to 'lib/mnesia/src/mnesia_dumper.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_dumper.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_dumper.erl b/lib/mnesia/src/mnesia_dumper.erl index 845ad0ac39..e404302b71 100644 --- a/lib/mnesia/src/mnesia_dumper.erl +++ b/lib/mnesia/src/mnesia_dumper.erl @@ -562,7 +562,7 @@ insert_op(Tid, _, {op, change_table_copy_type, N, FromS, ToS, TabDef}, InPlace, {{ext,_FromAlias,_FromMod},{ext,ToAlias,ToMod}} -> disc_delete_table(Tab, FromS), ok = ToMod:delete_table(ToAlias, Tab), - ok = ToMod:create_table(ToAlias, Tab, []), + ok = mnesia_monitor:unsafe_create_external(Tab, ToAlias, ToMod, TabDef), ok = ToMod:load_table(ToAlias, Tab, {dumper,change_table_copy_type}, TabDef), ok = load_from_logfile(ToS, Tab, Logtmp), file:delete(Logtmp), @@ -582,7 +582,7 @@ insert_op(Tid, _, {op, change_table_copy_type, N, FromS, ToS, TabDef}, InPlace, end, ok = ToMod:delete_table(ToAlias, Tab), - ok = ToMod:create_table(ToAlias, Tab, []), + ok = mnesia_monitor:unsafe_create_external(Tab, ToAlias, ToMod, TabDef), ok = ToMod:load_table(ToAlias, Tab, {dumper,change_table_copy_type}, TabDef), ok = load_from_logfile(ToS, Tab, Logtmp), file:delete(Logtmp), @@ -1401,6 +1401,8 @@ load_from_logfile(Storage, Tab, F) -> {linkto, self()}]) of {ok, Fd} -> chunk_from_log(disk_log:chunk(Fd, start), Fd, Storage, Tab); + {repaired, Fd, _, _} -> + chunk_from_log(disk_log:chunk(Fd, start), Fd, Storage, Tab); {error, _} = E -> E end. |