aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_checkpoint.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-01-31 15:08:36 +0100
committerErlang/OTP <[email protected]>2017-01-31 15:08:36 +0100
commitb674eaa8c616a341bec19254e6b3f04cecc2a2f1 (patch)
tree1980d806b64e45f996f7188116b75ebf7550c98d /lib/mnesia/src/mnesia_checkpoint.erl
parentbca5bf5a2d68a0e9ca681363a8943809c4751950 (diff)
parent230358701da9764fa4c637e9e781668276f14938 (diff)
downloadotp-b674eaa8c616a341bec19254e6b3f04cecc2a2f1.tar.gz
otp-b674eaa8c616a341bec19254e6b3f04cecc2a2f1.tar.bz2
otp-b674eaa8c616a341bec19254e6b3f04cecc2a2f1.zip
Merge branch 'dgud/mnesia/checkpoint-crash/OTP-14167' into maint-19
* dgud/mnesia/checkpoint-crash/OTP-14167: Fixed crash when a table was deleted during checkpoint traversal
Diffstat (limited to 'lib/mnesia/src/mnesia_checkpoint.erl')
-rw-r--r--lib/mnesia/src/mnesia_checkpoint.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/mnesia/src/mnesia_checkpoint.erl b/lib/mnesia/src/mnesia_checkpoint.erl
index 9eb939e8d3..fc626940b4 100644
--- a/lib/mnesia/src/mnesia_checkpoint.erl
+++ b/lib/mnesia/src/mnesia_checkpoint.erl
@@ -909,7 +909,7 @@ retainer_loop(Cp = #checkpoint_args{name=Name}) ->
retainer_loop(Cp2);
{From, {iter_end, Iter}} ->
- retainer_fixtable(Iter#iter.oid_tab, false),
+ ?SAFE(retainer_fixtable(Iter#iter.oid_tab, false)),
Iters = Cp#checkpoint_args.iterators -- [Iter],
reply(From, Name, ok),
retainer_loop(Cp#checkpoint_args{iterators = Iters});
@@ -971,7 +971,8 @@ do_stop(Cp) ->
unset({checkpoint, Name}),
lists:foreach(fun deactivate_tab/1, Cp#checkpoint_args.retainers),
Iters = Cp#checkpoint_args.iterators,
- lists:foreach(fun(I) -> retainer_fixtable(I#iter.oid_tab, false) end, Iters).
+ [?SAFE(retainer_fixtable(Tab, false)) || #iter{main_tab=Tab} <- Iters],
+ ok.
deactivate_tab(R) ->
Name = R#retainer.cp_name,
@@ -1151,7 +1152,7 @@ do_change_copy(Cp, Tab, FromType, ToType) ->
Cp#checkpoint_args{retainers = Rs, nodes = writers(Rs)}.
check_iter(From, Iter) when Iter#iter.pid == From ->
- retainer_fixtable(Iter#iter.oid_tab, false),
+ ?SAFE(retainer_fixtable(Iter#iter.oid_tab, false)),
false;
check_iter(_From, _Iter) ->
true.