diff options
Diffstat (limited to 'lib/mnesia')
-rw-r--r-- | lib/mnesia/src/mnesia.app.src | 3 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia.hrl | 4 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia_index.erl | 6 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia_lib.erl | 13 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia_locker.erl | 3 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia_recover.erl | 6 | ||||
-rw-r--r-- | lib/mnesia/src/mnesia_snmp_hook.erl | 8 | ||||
-rw-r--r-- | lib/mnesia/test/mnesia_config_test.erl | 7 | ||||
-rw-r--r-- | lib/mnesia/test/mnesia_evil_coverage_test.erl | 11 | ||||
-rw-r--r-- | lib/mnesia/vsn.mk | 2 |
10 files changed, 43 insertions, 20 deletions
diff --git a/lib/mnesia/src/mnesia.app.src b/lib/mnesia/src/mnesia.app.src index 3715488ec2..e755864792 100644 --- a/lib/mnesia/src/mnesia.app.src +++ b/lib/mnesia/src/mnesia.app.src @@ -47,6 +47,7 @@ mnesia_tm ]}, {applications, [kernel, stdlib]}, - {mod, {mnesia_sup, []}}]}. + {mod, {mnesia_sup, []}}, + {runtime_dependencies, ["stdlib-2.0","kernel-3.0","erts-6.0"]}]}. diff --git a/lib/mnesia/src/mnesia.hrl b/lib/mnesia/src/mnesia.hrl index 2855792646..c8010d5466 100644 --- a/lib/mnesia/src/mnesia.hrl +++ b/lib/mnesia/src/mnesia.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2014. 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 @@ -35,7 +35,7 @@ -define(ets_last(Tab), ets:last(Tab)). -define(ets_prev(Tab, Key), ets:prev(Tab, Key)). -define(ets_slot(Tab, Pos), ets:slot(Tab, Pos)). --define(ets_new_table(Tab, Props), ets:new(Tab, Props)). +-define(ets_new_table(Tab, Props), _ = ets:new(Tab, Props)). -define(ets_delete_table(Tab), ets:delete(Tab)). -define(ets_fixtable(Tab, Bool), ets:fixtable(Tab, Bool)). diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl index 8fef611a48..87cb58dae1 100644 --- a/lib/mnesia/src/mnesia_index.erl +++ b/lib/mnesia/src/mnesia_index.erl @@ -52,7 +52,11 @@ val(Var) -> case ?catch_val(Var) of - {'EXIT', _ReASoN_} -> mnesia_lib:other_val(Var, _ReASoN_); + {'EXIT', _ReASoN_} -> + case mnesia_lib:other_val(Var) of + error -> mnesia_lib:pr_other(Var, _ReASoN_); + Val -> Val + end; _VaLuE_ -> _VaLuE_ end. diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl index 109e924971..a32c69c59e 100644 --- a/lib/mnesia/src/mnesia_lib.erl +++ b/lib/mnesia/src/mnesia_lib.erl @@ -115,6 +115,8 @@ mkcore/1, not_active_here/1, other_val/2, + other_val/1, + pr_other/2, overload_read/0, overload_read/1, overload_set/2, @@ -389,16 +391,19 @@ unset(Var) -> ?ets_delete(mnesia_gvar, Var). other_val(Var, Other) -> + case other_val(Var) of + error -> pr_other(Var, Other); + Val -> Val + end. + +other_val(Var) -> case Var of {_, where_to_read} -> nowhere; {_, where_to_write} -> []; {_, active_replicas} -> []; - _ -> - pr_other(Var, Other) + _ -> error end. --spec pr_other(_,_) -> no_return(). - pr_other(Var, Other) -> Why = case is_running() of diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl index 32cea903c9..81b435c6dc 100644 --- a/lib/mnesia/src/mnesia_locker.erl +++ b/lib/mnesia/src/mnesia_locker.erl @@ -270,7 +270,8 @@ try_sticky_lock(Tid, Op, Pid, {Tab, _} = Oid) -> try_lock(Tid, Op, Pid, Oid); [{_,N}] -> Req = {Pid, {Op, Tid, Oid}}, - Pid ! {?MODULE, node(), {switch, N, Req}} + Pid ! {?MODULE, node(), {switch, N, Req}}, + true end. try_lock(Tid, read_write, Pid, Oid) -> diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl index 0548a25ebf..b6492707e2 100644 --- a/lib/mnesia/src/mnesia_recover.erl +++ b/lib/mnesia/src/mnesia_recover.erl @@ -178,7 +178,11 @@ log_decision(D) -> val(Var) -> case ?catch_val(Var) of - {'EXIT', Reason} -> mnesia_lib:other_val(Var, Reason); + {'EXIT', Reason} -> + case mnesia_lib:other_val(Var) of + error -> mnesia_lib:pr_other(Var, Reason); + Val -> Val + end; Value -> Value end. diff --git a/lib/mnesia/src/mnesia_snmp_hook.erl b/lib/mnesia/src/mnesia_snmp_hook.erl index 893b39f3c0..256f83b029 100644 --- a/lib/mnesia/src/mnesia_snmp_hook.erl +++ b/lib/mnesia/src/mnesia_snmp_hook.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2014. 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 @@ -32,7 +32,11 @@ val(Var) -> case ?catch_val(Var) of - {'EXIT', _ReASoN_} -> mnesia_lib:other_val(Var, _ReASoN_); + {'EXIT', _ReASoN_} -> + case mnesia_lib:other_val(Var) of + error -> mnesia_lib:pr_other(Var, _ReASoN_); + Val -> Val + end; _VaLuE_ -> _VaLuE_ end. diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 6baf86a4a5..c495bce63f 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2013. All Rights Reserved. +%% Copyright Ericsson AB 1997-2014. 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 @@ -639,10 +639,10 @@ send_compressed(Config) -> end, ?match([], mnesia_test_lib:kill_mnesia([N2])), - + sys:get_status(mnesia_monitor), %% sync N1 ?match([], mnesia_test_lib:kill_mnesia([N1])), ?match(ok, mnesia:start([{send_compressed, 9}])), - ?match(ok, mnesia:wait_for_tables([t0,t1,t2], 5000)), + ?match(ok, mnesia:wait_for_tables([t0,t1,t2], 25000)), ?match({atomic, ok}, mnesia:transaction(Create, [t0])), ?match({atomic, ok}, mnesia:transaction(Create, [t1])), @@ -1158,6 +1158,7 @@ dynamic_basic(Config) when is_list(Config) -> %%% SYNC!!! timer:sleep(1000), + sys:get_status(mnesia_monitor), ?match([N3,N1], sort(rpc:call(N1, mnesia, system_info, [running_db_nodes]))), ?match([N3,N1], sort(rpc:call(N3, mnesia, system_info, [running_db_nodes]))), diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 91820238e5..2d1623b6ca 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2013. All Rights Reserved. +%% Copyright Ericsson AB 1996-2014. 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 @@ -671,13 +671,16 @@ add_copy_when_going_down(Config) -> ?acquire_nodes(2, Config ++ [{tc_timeout, timer:minutes(2)}]), ?match({atomic, ok}, mnesia:create_table(a, [{ram_copies, [Node1]}])), %% Grab a write lock + Tester = self(), WriteAndWait = fun() -> mnesia:write({a,1,1}), - receive continue -> ok + Tester ! {self(), got_lock}, + receive continue -> ok end end, - _Lock = spawn(fun() -> mnesia:transaction(WriteAndWait) end), - Tester = self(), + Locker = spawn(fun() -> mnesia:transaction(WriteAndWait) end), + receive {Locker, got_lock} -> ok end, + spawn_link(fun() -> Res = rpc:call(Node2, mnesia, add_table_copy, [a, Node2, ram_copies]), Tester ! {test, Res} diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk index 064ba43791..c596f98c81 100644 --- a/lib/mnesia/vsn.mk +++ b/lib/mnesia/vsn.mk @@ -1 +1 @@ -MNESIA_VSN = 4.11 +MNESIA_VSN = 4.12 |