aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_locker.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2019-07-25 11:07:28 +0200
committerDan Gudmundsson <[email protected]>2019-07-25 11:07:28 +0200
commitedfeb5d9b7dcba2380f629b5a41cbab65cd40cb8 (patch)
treee37833d71d63c5417e7abb43ab9a94bcfc2cc927 /lib/mnesia/src/mnesia_locker.erl
parent8418260650c37153dffb0515485dcfc0ff4af55c (diff)
downloadotp-edfeb5d9b7dcba2380f629b5a41cbab65cd40cb8.tar.gz
otp-edfeb5d9b7dcba2380f629b5a41cbab65cd40cb8.tar.bz2
otp-edfeb5d9b7dcba2380f629b5a41cbab65cd40cb8.zip
mnesia: Introduce sync_asym_trans protocol
Transactions with sticky locks could with async_asym transactions be committed in the wrong order, since asym transaction are spawned on the remote nodes. See ERL-768.
Diffstat (limited to 'lib/mnesia/src/mnesia_locker.erl')
-rw-r--r--lib/mnesia/src/mnesia_locker.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl
index f68626413e..0222c5b1a0 100644
--- a/lib/mnesia/src/mnesia_locker.erl
+++ b/lib/mnesia/src/mnesia_locker.erl
@@ -774,10 +774,12 @@ do_sticky_lock(Tid, Store, {Tab, Key} = Oid, Lock) ->
N = node(),
receive
{?MODULE, N, granted} ->
+ ?ets_insert(Store, {sticky, true}),
?ets_insert(Store, {{locks, Tab, Key}, write}),
[?ets_insert(Store, {nodes, Node}) || Node <- WNodes],
granted;
{?MODULE, N, {granted, Val}} -> %% for rwlocks
+ ?ets_insert(Store, {sticky, true}),
case opt_lookup_in_client(Val, Oid, write) of
C = #cyclic{} ->
exit({aborted, C});