From edfeb5d9b7dcba2380f629b5a41cbab65cd40cb8 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 25 Jul 2019 11:07:28 +0200 Subject: 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. --- lib/mnesia/src/mnesia_locker.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/mnesia/src/mnesia_locker.erl') 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}); -- cgit v1.2.3