aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_dumper.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-03-29 15:22:37 +0200
committerDan Gudmundsson <[email protected]>2016-05-09 14:55:54 +0200
commit6fad79dbddf78f6fa4a91bc922234437c8181b7b (patch)
tree5207e3fa11c0437c738f0ae91a458d1a2dac0ea6 /lib/mnesia/src/mnesia_dumper.erl
parent545d88ac5b1a6bb6fe219c3175e1cafd716f1581 (diff)
downloadotp-6fad79dbddf78f6fa4a91bc922234437c8181b7b.tar.gz
otp-6fad79dbddf78f6fa4a91bc922234437c8181b7b.tar.bz2
otp-6fad79dbddf78f6fa4a91bc922234437c8181b7b.zip
mnesia_ext: reuse snmp field for ext updates
Minimal impact when talking to older nodes.
Diffstat (limited to 'lib/mnesia/src/mnesia_dumper.erl')
-rw-r--r--lib/mnesia/src/mnesia_dumper.erl17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/mnesia/src/mnesia_dumper.erl b/lib/mnesia/src/mnesia_dumper.erl
index e404302b71..de430eaecd 100644
--- a/lib/mnesia/src/mnesia_dumper.erl
+++ b/lib/mnesia/src/mnesia_dumper.erl
@@ -229,11 +229,11 @@ insert_rec(Rec, InPlace, InitBy, LogV) when is_record(Rec, commit) ->
D = Rec#commit.decision,
case mnesia_recover:wait_for_decision(D, InitBy) of
{Tid, committed} ->
- do_insert_rec(Tid, Rec, InPlace, InitBy, LogV);
+ do_insert_rec(Tid, mnesia_tm:new_cr_format(Rec), InPlace, InitBy, LogV);
{Tid, aborted} ->
case InitBy of
startup ->
- mnesia_schema:undo_prepare_commit(Tid, Rec);
+ mnesia_schema:undo_prepare_commit(Tid, mnesia_tm:new_cr_format(Rec));
_ ->
ok
end
@@ -288,10 +288,15 @@ do_insert_rec(Tid, Rec, InPlace, InitBy, LogV) ->
ignore
end.
-commit_ext(#commit{external_copies = C}) ->
- lists:foldl(fun({Ext, Op}, D) ->
- orddict:append(Ext, Op, D)
- end, orddict:new(), C).
+commit_ext(#commit{ext = []}) -> [];
+commit_ext(#commit{ext = Ext}) ->
+ case lists:keyfind(ext_copies, 1, Ext) of
+ {_, C} ->
+ lists:foldl(fun({Ext0, Op}, D) ->
+ orddict:append(Ext0, Op, D)
+ end, orddict:new(), C);
+ false -> []
+ end.
update(_Tid, [], _DumperMode) ->
dumped;