diff options
author | Henrik Nord <[email protected]> | 2011-05-17 11:57:11 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-05-17 11:57:25 +0200 |
commit | 0d2d95e4e3605d31d7032914ed623a91ef01ff25 (patch) | |
tree | 5dfe3d43ef6a24df423834fc864e834660c03b71 /lib/mnesia/src/mnesia.erl | |
parent | 23db3a53e9c77eee4b1b94bd26c13a9c68718189 (diff) | |
parent | 8d7963d76fb651f6cb250033a0a5a643abd01389 (diff) | |
download | otp-0d2d95e4e3605d31d7032914ed623a91ef01ff25.tar.gz otp-0d2d95e4e3605d31d7032914ed623a91ef01ff25.tar.bz2 otp-0d2d95e4e3605d31d7032914ed623a91ef01ff25.zip |
Merge branch 'uw/mnesia-majority' into dev
* uw/mnesia-majority:
dialyzer warning on mnesia_tm
Add documentation text about majority checking
add mnesia_majority_test suite
where_to_wlock optimization + change_table_majority/2
bug in mnesia_tm:needs_majority/2
optimize sticky_lock maj. check
check majority for sticky locks
Write locks now check majority when needed.
Add {majority, boolean()} per-table option.
OTP-9304
Diffstat (limited to 'lib/mnesia/src/mnesia.erl')
-rw-r--r-- | lib/mnesia/src/mnesia.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl index 025b32f506..980a9c6213 100644 --- a/lib/mnesia/src/mnesia.erl +++ b/lib/mnesia/src/mnesia.erl @@ -39,6 +39,7 @@ %% Access within an activity - Lock acquisition lock/2, lock/4, + lock_table/2, read_lock_table/1, write_lock_table/1, @@ -92,7 +93,7 @@ add_table_copy/3, del_table_copy/2, move_table_copy/3, add_table_index/2, del_table_index/2, transform_table/3, transform_table/4, - change_table_copy_type/3, + change_table_copy_type/3, change_table_majority/2, read_table_property/2, write_table_property/2, delete_table_property/2, change_table_frag/2, clear_table/1, clear_table/4, @@ -415,6 +416,9 @@ lock(LockItem, LockKind) -> abort(no_transaction) end. +lock_table(Tab, LockKind) -> + lock({table, Tab}, LockKind). + lock(Tid, Ts, LockItem, LockKind) -> case element(1, Tid) of tid -> @@ -467,6 +471,8 @@ lock_table(Tid, Ts, Tab, LockKind) when is_atom(Tab) -> mnesia_locker:rlock_table(Tid, Store, Tab); write -> mnesia_locker:wlock_table(Tid, Store, Tab); + load -> + mnesia_locker:load_lock_table(Tid, Store, Tab); sticky_write -> mnesia_locker:sticky_wlock_table(Tid, Store, Tab); none -> @@ -2455,6 +2461,9 @@ change_table_access_mode(T, Access) -> change_table_load_order(T, O) -> mnesia_schema:change_table_load_order(T, O). +change_table_majority(T, M) -> + mnesia_schema:change_table_majority(T, M). + set_master_nodes(Nodes) when is_list(Nodes) -> UseDir = system_info(use_dir), IsRunning = system_info(is_running), |