aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-03-17 10:23:41 +0100
committerDan Gudmundsson <[email protected]>2016-03-17 10:33:34 +0100
commit18128ff4e9ff7bd1fcb960edf084f8db839bdd8d (patch)
tree7a4fc2e22a80e0f8267c56b73f4b5ec764c5f0db /lib
parentd9318b579b555372cd86b4b11a50af9d46c7bb5d (diff)
downloadotp-18128ff4e9ff7bd1fcb960edf084f8db839bdd8d.tar.gz
otp-18128ff4e9ff7bd1fcb960edf084f8db839bdd8d.tar.bz2
otp-18128ff4e9ff7bd1fcb960edf084f8db839bdd8d.zip
mnesia: Send mnesia_down messages to waiting transactions
Mnesia didn't forward mnesia_down to transactions which where already decided to be aborted, but that could lead to hanging transactions still waiting for messages from the node which had stopped.
Diffstat (limited to 'lib')
-rw-r--r--lib/mnesia/src/mnesia_tm.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl
index e7ee938312..1d3eb87036 100644
--- a/lib/mnesia/src/mnesia_tm.erl
+++ b/lib/mnesia/src/mnesia_tm.erl
@@ -1692,13 +1692,10 @@ commit_participant(Coord, Tid, Bin, C0, DiscNs, _RamNs) ->
?eval_debug_fun({?MODULE, commit_participant, undo_prepare},
[{tid, Tid}]);
- {'EXIT', _, _} ->
+ {'EXIT', _MnesiaTM, Reason} ->
+ reply(Coord, {do_abort, Tid, self(), {bad_commit,Reason}}),
mnesia_recover:log_decision(D#decision{outcome = aborted}),
- ?eval_debug_fun({?MODULE, commit_participant, exit_log_abort},
- [{tid, Tid}]),
- mnesia_schema:undo_prepare_commit(Tid, C0),
- ?eval_debug_fun({?MODULE, commit_participant, exit_undo_prepare},
- [{tid, Tid}]);
+ mnesia_schema:undo_prepare_commit(Tid, C0);
Msg ->
verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~p~n",
@@ -2210,8 +2207,6 @@ reconfigure_coordinators(N, [{Tid, [Store | _]} | Coordinators]) ->
true ->
send_mnesia_down(Tid, Store, N)
end;
- aborted ->
- ignore; % avoid spurious mnesia_down messages
_ ->
%% Tell the coordinator about the mnesia_down
send_mnesia_down(Tid, Store, N)