Skip to content

Commit

Permalink
OTP-8402 Transactions could be left hanging if a node went down when
Browse files Browse the repository at this point in the history
          invoking mnesia:sync_transaction/[1,2]. Thanks Igor Ribeiro
          Sucupira.
  • Loading branch information
dgud authored and Erlang/OTP committed Feb 4, 2010
1 parent 3d02efe commit 2a0a4a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/mnesia/src/mnesia_monitor.erl
Expand Up @@ -497,7 +497,7 @@ handle_cast({mnesia_down, mnesia_locker, Node}, State) ->
process_q(State3);
false ->
%% No pending remote monitors
{noreply, State2}
process_q(State2)
end;

handle_cast({disconnect, Node}, State) ->
Expand Down
11 changes: 6 additions & 5 deletions lib/mnesia/src/mnesia_tm.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
%%
%%
%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
%%
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%%
%% %CopyrightEnd%
%%

Expand Down Expand Up @@ -1389,6 +1389,7 @@ multi_commit(sync_sym_trans, Tid, CR, Store) ->
{Outcome, []} = rec_all(WaitFor, Tid, do_commit, []),
?eval_debug_fun({?MODULE, multi_commit_sym_sync},
[{tid, Tid}, {outcome, Outcome}]),
[?ets_insert(Store, {waiting_for_commit_ack, Node}) || Node <- WaitFor],
rpc:abcast(DiscNs -- [node()], ?MODULE, {Tid, Outcome}),
rpc:abcast(RamNs -- [node()], ?MODULE, {Tid, Outcome}),
case Outcome of
Expand Down

0 comments on commit 2a0a4a2

Please sign in to comment.