diff options
Diffstat (limited to 'lib/mnesia')
31 files changed, 479 insertions, 850 deletions
diff --git a/lib/mnesia/doc/src/company.ps b/lib/mnesia/doc/src/company.ps deleted file mode 100644 index 64a45d07f3..0000000000 --- a/lib/mnesia/doc/src/company.ps +++ /dev/null @@ -1,213 +0,0 @@ -%!PS-Adobe-2.0 -%%Title: company.fig -%%Creator: fig2dev Version 3.1 Patchlevel 2 -%%CreationDate: Thu Oct 31 18:09:46 1996 -%%For: klacke@gin (Claes Wikstrom,EUA/SU) -%Magnification: 0.70 -%%Orientation: Portrait -%%BoundingBox: 79 343 516 498 -%%Pages: 1 -%%BeginSetup -%%IncludeFeature: *PageSize A4 -%%EndSetup -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def - -end -save -55.0 585.5 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def - /DrawEllipse { - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def - /savematrix mtrx currentmatrix def - x y tr xrad yrad sc 0 0 1 startangle endangle arc - closepath - savematrix setmatrix - } def - -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def -%%EndProlog - -$F2psBegin -10 setmiterlimit -n 0 842 m 0 0 l 595 0 l 595 842 l cp clip - 0.04200 0.04200 sc -%%Page: 1 1 -7.500 slw -% Polyline -n 8550 2700 m 10950 2700 l 10950 3150 l 8550 3150 l cp gs col-1 s gr -/Times-Roman ff 180.00 scf sf -8850 3000 m -gs 1 -1 sc (Project) col-1 sh gr -% Polyline -n 4950 2700 m 7350 2700 l 7350 3150 l 4950 3150 l cp gs col-1 s gr -/Times-Roman ff 180.00 scf sf -5325 3000 m -gs 1 -1 sc (Employee) col-1 sh gr -% Polyline -n 1275 2775 m 3675 2775 l 3675 3225 l 1275 3225 l cp gs col-1 s gr -/Times-Roman ff 180.00 scf sf -1650 3075 m -gs 1 -1 sc (Dept) col-1 sh gr -% Polyline -n 600 5100 m 1425 5700 l 2325 5100 l 1425 4500 l 600 5100 l gs col-1 s gr -/Times-Roman ff 180.00 scf sf -1125 5175 m -gs 1 -1 sc (Manager) col-1 sh gr -/Times-Roman ff 180.00 scf sf -9600 5175 m -gs 1 -1 sc (In_proj) col-1 sh gr -% Polyline -n 9000 5100 m 9825 5700 l 10725 5100 l 9825 4500 l 9000 5100 l gs col-1 s gr -% Ellipse -n 5287 2325 262 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 5812 2325 262 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 6337 2325 262 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 6862 2325 262 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 4612 2325 413 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 7537 2325 413 225 0 360 DrawEllipse gs col-1 s gr - -% Polyline -n 4800 2550 m 5925 2700 l gs col-1 s gr -% Polyline -n 5475 2550 m 5850 2700 l gs col-1 s gr -% Polyline -n 5850 2550 m 5850 2700 l gs col-1 s gr -% Polyline -n 6300 2550 m 5850 2700 l gs col-1 s gr -% Polyline -n 6750 2550 m 5850 2700 l gs col-1 s gr -% Polyline -n 7275 2550 m 5925 2700 l gs col-1 s gr -/Times-Roman ff 180.00 scf sf -4350 2400 m -gs 1 -1 sc (emp_no name salary sex phone room_no) col-1 sh gr -/Times-Roman ff 180.00 scf sf -3900 5175 m -gs 1 -1 sc (At_dep) col-1 sh gr -% Polyline -n 3323 5135 m 4148 5735 l 5048 5135 l 4148 4535 l 3323 5135 l gs col-1 s gr -% Ellipse -n 1875 2287 600 187 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 3075 2287 600 187 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 8850 2325 450 225 0 360 DrawEllipse gs col-1 s gr - -% Ellipse -n 9750 2325 450 225 0 360 DrawEllipse gs col-1 s gr - -% Polyline -n 1575 3225 m 600 5100 l gs col-1 s gr -% Polyline -n 2325 5100 m 5250 3150 l gs col-1 s gr -% Polyline -n 5850 3150 m 5025 5175 l gs col-1 s gr -% Polyline -n 3300 5100 m 2550 3225 l gs col-1 s gr -% Polyline -n 7050 3150 m 9000 5100 l gs col-1 s gr -% Polyline -n 10725 5100 m 9825 3150 l gs col-1 s gr -% Polyline -n 1875 2475 m 2400 2775 l gs col-1 s gr -% Polyline -n 3075 2475 m 2400 2775 l gs col-1 s gr -% Polyline -n 9000 2550 m 9750 2700 l gs col-1 s gr -% Polyline -n 9750 2550 m 9675 2700 l gs col-1 s gr -/Times-Roman ff 180.00 scf sf -1575 2325 m -gs 1 -1 sc ( id name) col-1 sh gr -/Times-Roman ff 180.00 scf sf -8775 2400 m -gs 1 -1 sc (Name number ) col-1 sh gr -showpage -$F2psEnd -rs diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml index 04b8c106fd..790f5d92b5 100644 --- a/lib/mnesia/doc/src/notes.xml +++ b/lib/mnesia/doc/src/notes.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>1996</year><year>2012</year> + <year>1996</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -38,7 +38,93 @@ thus constitutes one section in this document. The title of each section is the version number of Mnesia.</p> - <section><title>Mnesia 4.7.1</title> + <section><title>Mnesia 4.9</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + If mnesia:clear_table/2 was called during a table load on + that table, the schema record was written to the table + instead of clearing table.</p> + <p> + Own Id: OTP-11030 Aux Id: seq12267 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Optimize index creation for Mnesia set tables. Thanks to + Nick Marino.</p> + <p> + Own Id: OTP-11103</p> + </item> + </list> + </section> + +</section> + +<section><title>Mnesia 4.8</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Use chained send_after instead of send_interval, to make + decrease the number of messages sent after a sleep + (Thanks to James Wheare)</p> + <p> + Own Id: OTP-10636</p> + </item> + <item> + <p> + Fix format of mnesia overload message (Thanks to Ahmed + Omar)</p> + <p> + Own Id: OTP-10639</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Added a general framework for executing benchmarks of + Erlang/OTP. Benchmarks for the Erlang VM and mnesia have + been incorporated in the framework. </p> + <p> + For details about how to add more benchmarks see + $ERL_TOP/HOWTO/BENCHMARKS.md in the source distribution.</p> + <p> + Own Id: OTP-10156</p> + </item> + <item> + <p>Where necessary a comment stating encoding has been + added to Erlang files. The comment is meant to be removed + in Erlang/OTP R17B when UTF-8 becomes the default + encoding. </p> + <p> + Own Id: OTP-10630</p> + </item> + <item> + <p> + Remove support for the query keyword and query + expressions. Thanks to Lo�c Hoguin.</p> + <p> + Own Id: OTP-10729</p> + </item> + </list> + </section> + +</section> + +<section><title>Mnesia 4.7.1</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/mnesia/examples/mnesia_tpcb.erl b/lib/mnesia/examples/mnesia_tpcb.erl index 903c53a21c..07ae73f0bd 100644 --- a/lib/mnesia/examples/mnesia_tpcb.erl +++ b/lib/mnesia/examples/mnesia_tpcb.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -99,9 +99,13 @@ replica_test/1, sticky_replica_test/1, remote_test/1, - remote_frag2_test/1 + remote_frag2_test/1, + + conflict_benchmark/1 ]). +-include_lib("common_test/include/ct_event.hrl"). + -define(SECOND, 1000000). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -191,8 +195,10 @@ driver_nodes = [node()], n_drivers_per_node = 1, use_running_mnesia = false, + seed, stop_after = timer:minutes(15), % Minimum 15 min report_interval = timer:minutes(1), + send_bench_report = false, use_sticky_locks = false, spawn_near_branch = false, activity_type = transaction, @@ -397,8 +403,30 @@ config(remote_frag2_test, ReplicaType) -> {stop_after, timer:minutes(1)}, {report_interval, timer:seconds(10)}, {reuse_history_id, true} + ]; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Ten drivers per node, tables replicated to all nodes, single branch + +config(conflict_benchmark, ReplicaType) -> + Remote = nodes(), + Local = node(), + Nodes = [Local | Remote], + [{seed, {1326,448637,337711}}, + {db_nodes, Nodes}, + {driver_nodes, Nodes}, + {replica_nodes, Nodes}, + {n_drivers_per_node, 10}, + {n_branches, 1}, + {n_accounts_per_branch, 10}, + {replica_type, ReplicaType}, + {stop_after, timer:minutes(1)}, + {report_interval, timer:seconds(10)}, + {send_bench_report, true}, + {reuse_history_id, true} ]. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start(What, ReplicaType) -> @@ -422,6 +450,9 @@ remote_test(ReplicaType) -> remote_frag2_test(ReplicaType) -> start(remote_frag2_test, ReplicaType). +conflict_benchmark(ReplicaType) -> + start(config(conflict_benchmark, ReplicaType)). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Args is a list of {Key, Val} tuples where Key is a field name %% in either the record tab_config or run_config. Unknown keys are ignored. @@ -866,6 +897,7 @@ add_time(Acc, New) -> show_report(State) -> Now = now_to_micros(erlang:now()), Iters = State#reporter_state.n_iters, + Cfg = State#reporter_state.run_config, Time = State#reporter_state.curr, Max = Time#time.max_time, N = Time#time.n_trans, @@ -888,7 +920,17 @@ show_report(State) -> "duration of longest transaction was ~p milliseconds~n", [Tps, BruttoTps, Max div 1000]) end, - State#reporter_state{prev_tps = Tps, prev_micros = Now}. + case Cfg#run_config.send_bench_report of + true -> + ct_event:notify( + #event{name = benchmark_data, + data = [{suite,"mnesia_tpcb"}, + {value,Tps}]}); + _ -> + ok + end, + + State#reporter_state{prev_tps = Tps, prev_micros = Now}. signed_diff(Iters, Curr, Prev) -> case Iters > 1 of @@ -955,7 +997,13 @@ alloc_local_branches([], Specs, OrphanBranches) -> {Specs, OrphanBranches}. driver_init(DS, AllBranches) -> - Seed = erlang:now(), + case (DS#driver_state.run_config)#run_config.seed of + undefined -> + Seed = erlang:now(); + Seed -> + Seed + end, + DS2 = if DS#driver_state.n_local_branches =:= 0 -> diff --git a/lib/mnesia/include/mnemosyne.hrl b/lib/mnesia/include/mnemosyne.hrl deleted file mode 100644 index eb6ec53ae1..0000000000 --- a/lib/mnesia/include/mnemosyne.hrl +++ /dev/null @@ -1,18 +0,0 @@ -%% ``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 via the world wide web 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. -%% -%% The Initial Developer of the Original Code is Ericsson Utvecklings AB. -%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings -%% AB. All Rights Reserved.'' -%% -%% $Id$ -%% --compile({parse_transform,mnemosyne}). diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile index 6f289433ff..ac38fa05ef 100644 --- a/lib/mnesia/src/Makefile +++ b/lib/mnesia/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1996-2012. All Rights Reserved. +# Copyright Ericsson AB 1996-2013. 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 @@ -93,10 +93,9 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) # FLAGS # ---------------------------------------------------- ERL_COMPILE_FLAGS += \ - +warn_unused_vars \ + -Werror \ +'{parse_transform,sys_pre_attributes}' \ - +'{attribute,insert,vsn,"mnesia_$(MNESIA_VSN)"}' \ - -W + +'{attribute,insert,vsn,"mnesia_$(MNESIA_VSN)"}' # ---------------------------------------------------- # Targets @@ -120,10 +119,10 @@ $(TARGET_FILES): $(HRL_FILES) # ---------------------------------------------------- $(APP_TARGET): $(APP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk - sed -e 's;%VSN%;$(VSN);' $< > $@ + $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@ # ---------------------------------------------------- diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl index 3d30debc53..70466d10d7 100644 --- a/lib/mnesia/src/mnesia.erl +++ b/lib/mnesia/src/mnesia.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -2186,7 +2186,6 @@ system_info2(dump_log_time_threshold) -> mnesia_monitor:get_env(dump_log_time_th system_info2(dump_log_update_in_place) -> mnesia_monitor:get_env(dump_log_update_in_place); system_info2(max_wait_for_decision) -> mnesia_monitor:get_env(max_wait_for_decision); -system_info2(embedded_mnemosyne) -> mnesia_monitor:get_env(embedded_mnemosyne); system_info2(ignore_fallback_at_startup) -> mnesia_monitor:get_env(ignore_fallback_at_startup); system_info2(fallback_error_function) -> mnesia_monitor:get_env(fallback_error_function); system_info2(log_version) -> mnesia_log:version(); @@ -2224,7 +2223,6 @@ system_info_items(yes) -> dump_log_time_threshold, dump_log_update_in_place, dump_log_write_threshold, - embedded_mnemosyne, event_module, extra_db_nodes, fallback_activated, diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl index d488a33d67..78f7bfa325 100644 --- a/lib/mnesia/src/mnesia_controller.erl +++ b/lib/mnesia/src/mnesia_controller.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -593,6 +593,12 @@ multicall(Nodes, Msg) -> {PatchedGood, Bad}. %% Make the replies look like rpc:multicalls.. %% rpc:multicall(Nodes, ?MODULE, call, [Msg]). +next_async_dump_log() -> + Interval = mnesia_monitor:get_env(dump_log_time_threshold), + Msg = {next_async_dump_log, time_threshold}, + Ref = erlang:send_after(Interval, self(), Msg), + Ref. + %%%---------------------------------------------------------------------- %%% Callback functions from gen_server %%%---------------------------------------------------------------------- @@ -614,9 +620,7 @@ init([Parent]) -> mnesia_lib:unset(original_nodes), mnesia_recover:connect_nodes(Diff), - Interval = mnesia_monitor:get_env(dump_log_time_threshold), - Msg = {async_dump_log, time_threshold}, - {ok, Ref} = timer:send_interval(Interval, Msg), + Ref = next_async_dump_log(), mnesia_dumper:start_regulator(), Empty = gb_trees:empty(), @@ -1121,6 +1125,11 @@ handle_sync_tabs([], _From) -> %% {stop, Reason, State} (terminate/2 is called) %%---------------------------------------------------------------------- +handle_info({next_async_dump_log, InitBy}, State) -> + async_dump_log(InitBy), + Ref = next_async_dump_log(), + noreply(State#state{dump_log_timer_ref=Ref}); + handle_info({async_dump_log, InitBy}, State) -> Worker = #dump_log{initiated_by = InitBy}, State2 = add_worker(Worker, State), diff --git a/lib/mnesia/src/mnesia_event.erl b/lib/mnesia/src/mnesia_event.erl index 8085155fd5..35fe2d4035 100644 --- a/lib/mnesia/src/mnesia_event.erl +++ b/lib/mnesia/src/mnesia_event.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -153,7 +153,7 @@ handle_system_event({mnesia_down, Node}, State) -> end; handle_system_event({mnesia_overload, Details}, State) -> - report_warning("Mnesia is overloaded: ~p~n", [Details]), + report_warning("Mnesia is overloaded: ~w~n", [Details]), {ok, State}; handle_system_event({mnesia_info, Format, Args}, State) -> diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl index f9f3ce2ea4..54db45e3ba 100644 --- a/lib/mnesia/src/mnesia_index.erl +++ b/lib/mnesia/src/mnesia_index.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2012. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -301,7 +301,13 @@ make_ram_index(Tab, [Pos | Tail]) -> add_ram_index(Tab, Pos) when is_integer(Pos) -> verbose("Creating index for ~w ~n", [Tab]), - Index = mnesia_monitor:mktab(mnesia_index, [bag, public]), + SetOrBag = val({Tab, setorbag}), + IndexType = case SetOrBag of + set -> duplicate_bag; + ordered_set -> duplicate_bag; + bag -> bag + end, + Index = mnesia_monitor:mktab(mnesia_index, [IndexType, public]), Insert = fun(Rec, _Acc) -> true = ?ets_insert(Index, {element(Pos, Rec), element(2, Rec)}) end, @@ -309,7 +315,7 @@ add_ram_index(Tab, Pos) when is_integer(Pos) -> true = ets:foldl(Insert, true, Tab), mnesia_lib:db_fixtable(ram_copies, Tab, false), mnesia_lib:set({Tab, {index, Pos}}, Index), - add_index_info(Tab, val({Tab, setorbag}), {Pos, {ram, Index}}); + add_index_info(Tab, SetOrBag, {Pos, {ram, Index}}); add_ram_index(_Tab, snmp) -> ok. diff --git a/lib/mnesia/src/mnesia_loader.erl b/lib/mnesia/src/mnesia_loader.erl index 4ba400fbbf..4afbea1cc2 100644 --- a/lib/mnesia/src/mnesia_loader.erl +++ b/lib/mnesia/src/mnesia_loader.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2011. All Rights Reserved. +%% Copyright Ericsson AB 1998-2013. 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 @@ -487,7 +487,8 @@ finish_copy(Storage,Tab,Cs,SenderPid,DatBin,OrigTabRec) -> subscr_receiver(TabRef = {_, Tab}, RecName) -> receive - {mnesia_table_event, {Op, Val, _Tid}} -> + {mnesia_table_event, {Op, Val, _Tid}} + when element(1, Val) =:= Tab -> if Tab == RecName -> handle_event(TabRef, Op, Val); @@ -496,6 +497,15 @@ subscr_receiver(TabRef = {_, Tab}, RecName) -> end, subscr_receiver(TabRef, RecName); + {mnesia_table_event, {Op, Val, _Tid}} when element(1, Val) =:= schema -> + %% clear_table is faked via two schema events + %% a schema record delete and a write + case Op of + delete -> handle_event(TabRef, clear_table, {Tab, all}); + _ -> ok + end, + subscr_receiver(TabRef, RecName); + {'EXIT', Pid, Reason} -> handle_exit(Pid, Reason), subscr_receiver(TabRef, RecName) diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl index a22c95d454..14011003d3 100644 --- a/lib/mnesia/src/mnesia_locker.erl +++ b/lib/mnesia/src/mnesia_locker.erl @@ -1177,9 +1177,9 @@ system_code_change(State, _Module, _OldVsn, _Extra) -> %% AXD301 patch sort pids according to R9B sort order %%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Om R9B == true, g�rs j�mf�relsen som i R9B plain. -%% Om R9B == false, g�rs j�mf�relsen som i alla andra releaser. -%% cmp_tid(T1, T2) returnerar -1 om T1 < T2, 0 om T1 = T2 och 1 om T1 > T2. +%% Om R9B == true, the comparison is done as in R9B plain. +%% Om R9B == false, the comparison is done as in any other release. +%% cmp_tid(T1, T2) returns -1 if T1 < T2, 0 if T1 = T2 and 1 if T1 > T2. -define(VERSION_MAGIC, 131). -define(ATOM_EXT, 100). diff --git a/lib/mnesia/src/mnesia_monitor.erl b/lib/mnesia/src/mnesia_monitor.erl index c08bbc879f..7a788238fc 100644 --- a/lib/mnesia/src/mnesia_monitor.erl +++ b/lib/mnesia/src/mnesia_monitor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -673,7 +673,6 @@ env() -> dump_log_time_threshold, dump_log_update_in_place, dump_log_write_threshold, - embedded_mnemosyne, event_module, extra_db_nodes, ignore_fallback_at_startup, @@ -706,8 +705,6 @@ default_env(dump_log_update_in_place) -> true; default_env(dump_log_write_threshold) -> 1000; -default_env(embedded_mnemosyne) -> - false; default_env(event_module) -> mnesia_event; default_env(extra_db_nodes) -> @@ -757,7 +754,6 @@ do_check_type(event_module, A) when is_atom(A) -> A; do_check_type(ignore_fallback_at_startup, B) -> bool(B); do_check_type(fallback_error_function, {Mod, Func}) when is_atom(Mod), is_atom(Func) -> {Mod, Func}; -do_check_type(embedded_mnemosyne, B) -> bool(B); do_check_type(extra_db_nodes, L) when is_list(L) -> Fun = fun(N) when N == node() -> false; (A) when is_atom(A) -> true diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl index 4750291a10..7aa03bda37 100644 --- a/lib/mnesia/src/mnesia_recover.erl +++ b/lib/mnesia/src/mnesia_recover.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -45,7 +45,8 @@ note_log_decision/2, outcome/2, start/0, - start_garb/0, + next_garb/0, + next_check_overload/0, still_pending/1, sync_trans_tid_serial/1, sync/0, @@ -91,10 +92,38 @@ start() -> init() -> call(init). -start_garb() -> +next_garb() -> Pid = whereis(mnesia_recover), - {ok, _} = timer:send_interval(timer:minutes(2), Pid, garb_decisions), - {ok, _} = timer:send_interval(timer:seconds(10), Pid, check_overload). + erlang:send_after(timer:minutes(2), Pid, garb_decisions). + +next_check_overload() -> + Pid = whereis(mnesia_recover), + erlang:send_after(timer:seconds(10), Pid, check_overload). + + +do_check_overload(S) -> + %% Time to check if mnesia_tm is overloaded + case whereis(mnesia_tm) of + Pid when is_pid(Pid) -> + Threshold = 100, + Prev = S#state.tm_queue_len, + {message_queue_len, Len} = + process_info(Pid, message_queue_len), + if + Len > Threshold, Prev > Threshold -> + What = {mnesia_tm, message_queue_len, [Prev, Len]}, + mnesia_lib:report_system_event({mnesia_overload, What}), + mnesia_lib:overload_set(mnesia_tm, true), + S#state{tm_queue_len = 0}; + Len > Threshold -> + S#state{tm_queue_len = Len}; + true -> + mnesia_lib:overload_set(mnesia_tm, false), + S#state{tm_queue_len = 0} + end; + undefined -> + S + end. allow_garb() -> cast(allow_garb). @@ -853,34 +882,13 @@ handle_info({connect_nodes, Ns, From}, State) -> handle_call({connect_nodes,Ns},From,State); handle_info(check_overload, S) -> - %% Time to check if mnesia_tm is overloaded - case whereis(mnesia_tm) of - Pid when is_pid(Pid) -> - - Threshold = 100, - Prev = S#state.tm_queue_len, - {message_queue_len, Len} = - process_info(Pid, message_queue_len), - if - Len > Threshold, Prev > Threshold -> - What = {mnesia_tm, message_queue_len, [Prev, Len]}, - mnesia_lib:report_system_event({mnesia_overload, What}), - mnesia_lib:overload_set(mnesia_tm, true), - {noreply, S#state{tm_queue_len = 0}}; - - Len > Threshold -> - {noreply, S#state{tm_queue_len = Len}}; - - true -> - mnesia_lib:overload_set(mnesia_tm, false), - {noreply, S#state{tm_queue_len = 0}} - end; - undefined -> - {noreply, S} - end; + State2 = do_check_overload(S), + next_check_overload(), + {noreply, State2}; handle_info(garb_decisions, State) -> do_garb_decisions(), + next_garb(), {noreply, State}; handle_info({force_decision, Tid}, State) -> diff --git a/lib/mnesia/src/mnesia_subscr.erl b/lib/mnesia/src/mnesia_subscr.erl index 415c69d508..8f78dc55e8 100644 --- a/lib/mnesia/src/mnesia_subscr.erl +++ b/lib/mnesia/src/mnesia_subscr.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -447,8 +447,12 @@ deactivate(ClientPid, What, Var, SubscrTab) -> {'EXIT', _} -> unlink(ClientPid) end, - del_subscr(Var, What, ClientPid), - {ok, node()}. + try + del_subscr(Var, What, ClientPid), + {ok, node()} + catch _:_ -> + {error, badarg} + end. del_subscr(subscribers, _What, Pid) -> mnesia_lib:del(subscribers, Pid); diff --git a/lib/mnesia/src/mnesia_sup.erl b/lib/mnesia/src/mnesia_sup.erl index 9ee4086f50..8443fefe7f 100644 --- a/lib/mnesia/src/mnesia_sup.erl +++ b/lib/mnesia/src/mnesia_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -60,9 +60,8 @@ init() -> Event = event_procs(), Kernel = kernel_procs(), - Mnemosyne = mnemosyne_procs(), - {ok, {Flags, Event ++ Kernel ++ Mnemosyne}}. + {ok, {Flags, Event ++ Kernel}}. event_procs() -> KillAfter = timer:seconds(30), @@ -75,16 +74,6 @@ kernel_procs() -> KA = infinity, [{K, {K, start, []}, permanent, KA, supervisor, [K, supervisor]}]. -mnemosyne_procs() -> - case mnesia_monitor:get_env(embedded_mnemosyne) of - true -> - Q = mnemosyne_sup, - KA = infinity, - [{Q, {Q, start, []}, permanent, KA, supervisor, [Q, supervisor]}]; - false -> - [] - end. - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% event handler diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl index 0af7f55c06..e54e5c4e88 100644 --- a/lib/mnesia/src/mnesia_tm.erl +++ b/lib/mnesia/src/mnesia_tm.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -103,7 +103,8 @@ init(Parent) -> end, mnesia_schema:purge_tmp_files(), - mnesia_recover:start_garb(), + mnesia_recover:next_garb(), + mnesia_recover:next_check_overload(), ?eval_debug_fun({?MODULE, init}, [{nodes, AllOthers}]), diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile index 509dddc85d..45ce5b1983 100644 --- a/lib/mnesia/test/Makefile +++ b/lib/mnesia/test/Makefile @@ -26,6 +26,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk MODULES= \ mt \ mnesia_SUITE \ + mnesia_bench_SUITE \ mnesia_test_lib \ mnesia_install_test \ mnesia_registry_test \ @@ -117,7 +118,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) "$(RELSYSDIR)" - $(INSTALL_DATA) mnesia.spec mnesia.cover $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)" + $(INSTALL_DATA) mnesia.spec mnesia_bench.spec mnesia.cover $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)" $(INSTALL_SCRIPT) mt $(INSTALL_PROGS) "$(RELSYSDIR)" # chmod -R u+w "$(RELSYSDIR)" # @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -) diff --git a/lib/mnesia/test/mnesia.spec b/lib/mnesia/test/mnesia.spec index 204d1519cb..e4746fe14c 100644 --- a/lib/mnesia/test/mnesia.spec +++ b/lib/mnesia/test/mnesia.spec @@ -1,4 +1,4 @@ -{suites,"../mnesia_test",all}. +{suites,"../mnesia_test",[mnesia_SUITE]}. {skip_cases,"../mnesia_test",mnesia_measure_test, [ram_meter], "Takes to long time"}. @@ -42,9 +42,6 @@ {skip_cases,"../mnesia_test",mnesia_measure_test, [measure_all_api_functions], "Not yet implemented"}. -{skip_cases,"../mnesia_test",mnesia_measure_test, - [mnemosyne_vs_mnesia_kernel], - "Not yet implemented"}. {skip_cases,"../mnesia_test",mnesia_examples_test, [company], "Not yet implemented"}. diff --git a/lib/mnesia/test/mnesia.spec.vxworks b/lib/mnesia/test/mnesia.spec.vxworks deleted file mode 100644 index 11c01ea3fe..0000000000 --- a/lib/mnesia/test/mnesia.spec.vxworks +++ /dev/null @@ -1,362 +0,0 @@ -{topcase, {dir, "../mnesia_test"}}. -{require_nodenames, 3}. -{diskless, true}. -{skip, {mnesia_measure_test, all, "Too heavy"}}. -%{mnesia_install_test, silly_durability} 'IMPL' -%{mnesia_install_test, silly_move} 'IMPL' -{skip, {mnesia_install_test, silly_upgrade, "Uses disk"}}. -%{mnesia_install_test, conflict} 'IMPL' -%{mnesia_install_test, dist} 'IMPL' -{skip, {mnesia_examples_test, all, "Uses disk"}}. -{skip, {mnesia_nice_coverage_test, all, "Uses disk"}}. - -%{mnesia_evil_coverage_test, system_info} 'IMPL' -%{mnesia_evil_coverage_test, table_info} 'IMPL' -%{mnesia_evil_coverage_test, error_description} 'IMPL' -{skip, {mnesia_evil_coverage_test, db_node_lifecycle, "Uses disk"}}. -{skip, {mnesia_evil_coverage_test, local_content, "Uses disk"}}. -%{mnesia_evil_coverage_test, start_and_stop} 'IMPL' -%{mnesia_evil_coverage_test, transaction} 'IMPL' -{skip, {mnesia_evil_coverage_test, checkpoint, "Uses disk"}}. -{skip, {mnesia_evil_backup, backup, "Uses disk"}}. -{skip, {mnesia_evil_backup, global_backup_checkpoint, "Uses disk"}}. -{skip, {mnesia_evil_backup, incremental_backup_checkpoint, "Uses disk"}}. -{skip, {mnesia_evil_backup, local_backup_checkpoint, "Uses disk"}}. -{skip, {mnesia_evil_backup, selective_backup_checkpoint, "Uses disk"}}. -{skip, {mnesia_evil_backup, restore_errors, "Uses disk"}}. -{skip, {mnesia_evil_backup, restore_clear, "Uses disk"}}. -{skip, {mnesia_evil_backup, restore_keep, "Uses disk"}}. -{skip, {mnesia_evil_backup, restore_recreate, "Uses disk"}}. -{skip, {mnesia_evil_backup, traverse_backup, "Uses disk"}}. -{skip, {mnesia_evil_backup, install_fallback, "Uses disk"}}. -{skip, {mnesia_evil_backup, uninstall_fallback, "Uses disk"}}. -{skip, {mnesia_evil_backup, local_fallback, "Uses disk"}}. -%{mnesia_evil_coverage_test, table_lifecycle} 'IMPL' -{skip, {mnesia_evil_coverage_test, replica_management, "Uses disk"}}. -%{mnesia_evil_coverage_test, change_table_access_mode} 'IMPL' -%{mnesia_evil_coverage_test, change_table_load_order} 'IMPL' -{skip, {mnesia_evil_coverage_test, set_master_nodes, "Uses disk"}}. -{skip, {mnesia_evil_coverage_test, offline_set_master_nodes, "Uses disk"}}. -{skip, {mnesia_evil_coverage_test, replica_location, "Uses disk"}}. -%{mnesia_evil_coverage_test, add_table_index_ram} 'IMPL' -{skip, {mnesia_trans_access_test, add_table_index_disc, "Uses disc"}}. -{skip, {mnesia_trans_access_test, add_table_index_disc_only, "Uses disc"}}. -%{mnesia_evil_coverage_test, create_live_table_index_ram} 'IMPL' -{skip, {mnesia_trans_access_test, create_live_table_index_disc, "Uses disc"}}. -{skip, {mnesia_trans_access_test, create_live_table_index_disc_only, "Uses disc"}}. -%{mnesia_evil_coverage_test, del_table_index_ram} 'IMPL' -{skip, {mnesia_trans_access_test, del_table_index_disc, "Uses disc"}}. -{skip, {mnesia_trans_access_test, del_table_index_disc_only, "Uses disc"}}. -{skip, {mnesia_trans_access_test, idx_schema_changes_ram, "Uses disk"}}. -{skip, {mnesia_trans_access_test, idx_schema_changes_disc, "Uses disc"}}. -{skip, {mnesia_trans_access_test, idx_schema_changes_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_write_ram} 'IMPL' - -{skip, {mnesia_dirty_access_test, dirty_write_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_write_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_read_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_read_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_read_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_update_counter_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_update_counter_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_update_counter_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_delete_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_delete_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_delete_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_delete_object_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_delete_object_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_delete_object_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_match_object_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_match_object_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_match_object_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_index_match_object_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_index_match_object_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_index_match_object_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_index_read_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_index_read_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_index_read_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_index_update_set_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_index_update_set_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_index_update_set_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_index_update_bag_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_index_update_bag_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_index_update_bag_disc_only, "Uses disc"}}. -%{mnesia_dirty_access_test, dirty_iter_ram} 'IMPL' -{skip, {mnesia_dirty_access_test, dirty_iter_disc, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, dirty_iter_disc_only, "Uses disc"}}. -{skip, {mnesia_dirty_access_test, admin_tests, "Uses disk"}}. - -%{mnesia_trans_access_test, write} 'IMPL' -%{mnesia_trans_access_test, read} 'IMPL' -%{mnesia_trans_access_test, wread} 'IMPL' -%{mnesia_trans_access_test, delete} 'IMPL' -%{mnesia_trans_access_test, delete_object} 'IMPL' -%{mnesia_trans_access_test, match_object} 'IMPL' -%{mnesia_trans_access_test, all_keys} 'IMPL' -%{mnesia_trans_access_test, index_match_object} 'IMPL' -%{mnesia_trans_access_test, index_read} 'IMPL' -%{mnesia_trans_access_test, index_update_set} 'IMPL' -%{mnesia_trans_access_test, index_update_bag} 'IMPL' -{skip, {mnesia_evil_coverage_test, dump_tables, "Uses disk"}}. -{skip, {mnesia_evil_coverage_test, dump_log, "Uses disk"}}. -%{mnesia_evil_coverage_test, wait_for_tables} 'IMPL' -{skip, {mnesia_evil_coverage_test, force_load_table, "Uses disk"}}. -%{mnesia_evil_coverage_test, user_properties} 'IMPL' -%{mnesia_evil_coverage_test, record_name_dirty_access_ram} 'IMPL' -{skip, {mnesia_evil_coverage_test, record_name_dirty_access_disc, "Uses disc"}}. -{skip, {mnesia_evil_coverage_test, record_name_dirty_access_disc_only, "Uses disc"}}. -%{mnesia_evil_coverage_test, snmp_open_table} 'IMPL' -%{mnesia_evil_coverage_test, snmp_close_table} 'IMPL' -%{mnesia_evil_coverage_test, snmp_get_next_index} 'IMPL' -%{mnesia_evil_coverage_test, snmp_get_row} 'IMPL' -%{mnesia_evil_coverage_test, snmp_get_mnesia_key} 'IMPL' -%{mnesia_evil_coverage_test, snmp_update_counter} 'IMPL' -%{mnesia_evil_coverage_test, info} 'IMPL' -%{mnesia_evil_coverage_test, schema_0} 'IMPL' -%{mnesia_evil_coverage_test, schema_1} 'IMPL' -%{mnesia_evil_coverage_test, view_0} 'IMPL' -{skip, {mnesia_evil_coverage_test, view_1, "Uses disk"}}. -{skip, {mnesia_evil_coverage_test, view_2, "Uses disk"}}. -%{mnesia_evil_coverage_test, lkill} 'IMPL' -%{mnesia_evil_coverage_test, kill} 'IMPL' - -%{mnesia_config_test, access_module} 'IMPL' -%{mnesia_config_test, auto_repair} 'IMPL' -{skip, {mnesia_config_test, backup_module, "Uses disk"}}. -{skip, {mnesia_config_test, dynamic_connect, "Uses disk"}}. -%{mnesia_config_test, debug} 'IMPL' -%{mnesia_config_test, dir} 'IMPL' -{skip, {mnesia_config_test, dump_log_load_regulation, "Uses disk"}}. -{skip, {mnesia_config_test, dump_log_time_threshold, "Uses disk"}}. -{skip, {mnesia_config_test, dump_log_write_threshold, "Uses disk"}}. -{skip, {mnesia_config_test, dump_log_update_in_place, "Uses disk"}}. -{skip, {mnesia_config_test, embedded_mnemosyne, "Uses Mnemosyne"}}. -%{mnesia_config_test, event_module} 'IMPL' -{skip, {mnesia_config_test, ignore_fallback_at_startup, "Not Yet impl"}}. -%{mnesia_config_test, inconsistent_database} 'IMPL' -{skip, {mnesia_config_test, max_wait_for_decision, "Not Yet impl"}}. -{skip, {mnesia_config_test, start_one_disc_full_then_one_disc_less, "Uses disc"}}. -{skip, {mnesia_config_test, start_first_one_disc_less_then_one_disc_full, "Uses disc"}}. -%%{skip, {mnesia_config_test, start_first_one_disc_less_then_two_more_disc_less, "Uses disc"}}. -{skip, {mnesia_config_test, schema_location_and_extra_db_nodes_combinations, "Uses disk"}}. -{skip, {mnesia_config_test, table_load_to_disc_less_nodes, "Uses disc"}}. -{skip, {mnesia_config_test, schema_merge, "Uses Disc"}}. -%{mnesia_config_test, unknown_config} 'IMPL' -%{mnesia_registry_test, good_dump} 'IMPL' -%{mnesia_registry_test, bad_dump} 'IMPL' - -%{mnesia_atomicity_test, explicit_abort_in_middle_of_trans} 'IMPL' -%{mnesia_atomicity_test, runtime_error_in_middle_of_trans} 'IMPL' -%{mnesia_atomicity_test, kill_self_in_middle_of_trans} 'IMPL' -%{mnesia_atomicity_test, throw_in_middle_of_trans} 'IMPL' -%{mnesia_atomicity_test, mnesia_down_during_infinite_trans} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_sw_rt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_sw_wt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wr_r} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_sw_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_sw_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_sw_wr} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wr_wt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wr_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wr_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_r_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_r_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_r_wt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_rt_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_rt_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_rt_wt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_r} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_rt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_wt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_wr} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_wt_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_wr} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_sw} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_r} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_w} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_rt} 'IMPL' -%{mnesia_atomicity_test, lock_waiter_w_wt} 'IMPL' -%{mnesia_atomicity_test, restart_r_one} 'IMPL' -%{mnesia_atomicity_test, restart_w_one} 'IMPL' -%{mnesia_atomicity_test, restart_rt_one} 'IMPL' -%{mnesia_atomicity_test, restart_wt_one} 'IMPL' -%{mnesia_atomicity_test, restart_wr_one} 'IMPL' -%{mnesia_atomicity_test, restart_sw_one} 'IMPL' -%{mnesia_atomicity_test, restart_r_two} 'IMPL' -%{mnesia_atomicity_test, restart_w_two} 'IMPL' -%{mnesia_atomicity_test, restart_rt_two} 'IMPL' -%{mnesia_atomicity_test, restart_wt_two} 'IMPL' -%{mnesia_atomicity_test, restart_wr_two} 'IMPL' -%{mnesia_atomicity_test, restart_sw_two} 'IMPL' - -%{mnesia_isolation_test, no_conflict} 'IMPL' -%{mnesia_isolation_test, simple_queue_conflict} 'IMPL' -%{mnesia_isolation_test, advanced_queue_conflict} 'IMPL' -%{mnesia_isolation_test, simple_deadlock_conflict} 'IMPL' -%{mnesia_isolation_test, advanced_deadlock_conflict} 'IMPL' -%{mnesia_isolation_test, lock_burst} 'IMPL' -%{mnesia_isolation_test, basic_sticky_functionality} 'IMPL' -%{mnesia_isolation_test, create_table} 'IMPL' -%{mnesia_isolation_test, delete_table} 'IMPL' -%{mnesia_isolation_test, move_table_copy} 'IMPL' -%{mnesia_isolation_test, add_table_index} 'IMPL' -%{mnesia_isolation_test, del_table_index} 'IMPL' -%{mnesia_isolation_test, transform_table} 'IMPL' -%{mnesia_isolation_test, snmp_open_table} 'IMPL' -%{mnesia_isolation_test, snmp_close_table} 'IMPL' -{skip, {mnesia_isolation_test, change_table_copy_type, "Uses disk"}}. -%{mnesia_isolation_test, change_table_access} 'IMPL' -%{mnesia_isolation_test, add_table_copy} 'IMPL' -%{mnesia_isolation_test, del_table_copy} 'IMPL' -{skip, {mnesia_isolation_test, dump_tables, "Uses disk"}}. -{skip, {mnesia_isolation_test, extra_admin_tests, "Uses disk"}}. -%{mnesia_isolation_test, del_table_copy_1} 'IMPL' -%{mnesia_isolation_test, del_table_copy_2} 'IMPL' -%{mnesia_isolation_test, del_table_copy_3} 'IMPL' -%{mnesia_isolation_test, add_table_copy_1} 'IMPL' -%{mnesia_isolation_test, add_table_copy_2} 'IMPL' -%{mnesia_isolation_test, add_table_copy_3} 'IMPL' -%{mnesia_isolation_test, add_table_copy_4} 'IMPL' -%{mnesia_isolation_test, move_table_copy_1} 'IMPL' -%{mnesia_isolation_test, move_table_copy_2} 'IMPL' -%{mnesia_isolation_test, move_table_copy_3} 'IMPL' -%{mnesia_isolation_test, move_table_copy_4} 'IMPL' -%{mnesia_isolation_test, dirty_updates_visible_direct} 'IMPL' -%{mnesia_isolation_test, dirty_reads_regardless_of_trans} 'IMPL' -%{mnesia_isolation_test, trans_update_invisibible_outside_trans} 'IMPL' -%{mnesia_isolation_test, trans_update_visible_inside_trans} 'IMPL' -%{mnesia_isolation_test, write_shadows} 'IMPL' -%{mnesia_isolation_test, delete_shadows} 'IMPL' -%{mnesia_isolation_test, write_delete_shadows_bag} 'IMPL' - -{skip, {mnesia_durability_test, all, "Uses disk "}}. -%{mnesia_durability_test, load_local_contents_directly} 'IMPL' -%{mnesia_durability_test, load_directly_when_all_are_ram_copiesA} 'IMPL' -%{mnesia_durability_test, load_directly_when_all_are_ram_copiesB} 'IMPL' -%{skip, {mnesia_durability_test, late_load_when_all_are_ram_copies_on_ram_nodes1, "Uses disk schema"}}. -%{skip, {mnesia_durability_test, late_load_when_all_are_ram_copies_on_ram_nodes2, "Uses disk schema"}}. -%{skip, {mnesia_durability_test, load_when_last_replica_becomes_available, "Uses disk"}}. -%{skip, {mnesia_durability_test, load_when_we_have_down_from_all_other_replica_nodes, "Uses disk"}}. -%{skip, {mnesia_durability_test, late_load_transforms_into_disc_load, "Uses disc"}}. -%{mnesia_durability_test, late_load_leads_to_hanging} 'IMPL' -%{mnesia_durability_test, force_load_when_nobody_intents_to_load} 'IMPL' -%{mnesia_durability_test, force_load_when_someone_has_decided_to_load} 'IMPL' -%{mnesia_durability_test, force_load_when_someone_else_already_has_loaded} 'IMPL' -%{mnesia_durability_test, force_load_when_we_has_loaded} 'IMPL' -%{mnesia_durability_test, force_load_on_a_non_local_table} 'IMPL' -%{mnesia_durability_test, force_load_when_the_table_does_not_exist} 'IMPL' -%{mnesia_durability_test, master_nodes} 'IMPL' -%{mnesia_durability_test, master_on_non_local_tables} 'IMPL' -%{mnesia_durability_test, remote_force_load_with_local_master_node} 'IMPL' -%{mnesia_durability_test, dump_ram_copies} 'IMPL' -%{skip, {mnesia_durability_test, dump_disc_copies, "Uses disc"}}. -%{skip, {mnesia_durability_test, dump_disc_only, "Uses disc"}}. -%{skip, {mnesia_durability_test, durability_of_disc_copies, "Uses disc"}}. -%{skip, {mnesia_durability_test, durability_of_disc_only_copies, "Uses disc"}}. - -{skip, {mnesia_recovery_test, mnesia_down, "Uses Disk"}}. -%{mnesia_recovery_test, no_master_2} 'IMPL' -%{mnesia_recovery_test, no_master_3} 'IMPL' -%{mnesia_recovery_test, one_master_2} 'IMPL' -%{mnesia_recovery_test, one_master_3} 'IMPL' -%{mnesia_recovery_test, two_master_2} 'IMPL' -%{mnesia_recovery_test, two_master_3} 'IMPL' -%{mnesia_recovery_test, all_master_2} 'IMPL' -%{mnesia_recovery_test, all_master_3} 'IMPL' -{skip, {mnesia_recovery_test, mnesia_down_during_startup_disk_ram, "Uses disk"}}. -%{mnesia_recovery_test, mnesia_down_during_startup_init_ram} 'IMPL' -{skip, {mnesia_recovery_test, mnesia_down_during_startup_init_disc, "Uses disc"}}. -{skip, {mnesia_recovery_test, mnesia_down_during_startup_init_disc_only, "Uses disc"}}. -%{mnesia_recovery_test, mnesia_down_during_startup_tm_ram} 'IMPL' -{skip, {mnesia_recovery_test, mnesia_down_during_startup_tm_disc, "Uses disc"}}. -{skip, {mnesia_recovery_test, mnesia_down_during_startup_tm_disc_only, "Uses disc"}}. -%{mnesia_recovery_test, explicit_stop_during_snmp} 'IMPL' - -{skip, {mnesia_recovery_test, schema_trans, "Uses Disk, needs disk log"}}. -{skip, {mnesia_recovery_test, async_dirty, "Uses disc"}}. -{skip, {mnesia_recovery_test, sync_dirty, "Uses disc"}}. -{skip, {mnesia_recovery_test, sym_trans, "Uses disc"}}. -{skip, {mnesia_recovery_test, asym_trans, "Uses disc"}}. - -{skip, {mnesia_recovery_test, after_full_disc_partition, "Not Yet impl"}}. -{skip, {mnesia_recovery_test, after_corrupt_files, "Uses disk"}}. - -%{mnesia_evil_coverage_test, subscriptions} 'IMPL' -%{mnesia_evil_coverage_test, nested_trans_both_ok} 'IMPL' -%{mnesia_evil_coverage_test, nested_trans_child_dies} 'IMPL' -%{mnesia_evil_coverage_test, nested_trans_parent_dies} 'IMPL' -%{mnesia_evil_coverage_test, nested_trans_both_dies} 'IMPL' -%{mnesia_evil_coverage_test, mix_of_trans_sync_dirty} 'IMPL' -%{mnesia_evil_coverage_test, mix_of_trans_async_dirty} 'IMPL' -%{mnesia_evil_coverage_test, mix_of_trans_ets} 'IMPL' - -{skip, {mnesia_recovery_test, disc_less, "Uses disc (on the other nodes)"}}. -{skip, {mnesia_recovery_test, system_upgrade, "Not Yet impl"}}. -%{mnesia_consistency_test, consistency_after_restart_1_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_restart_1_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restart_1_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_restart_2_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_restart_2_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restart_2_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_dump_tables_1_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, consistency_after_dump_tables_2_ram, "Uses disk"}}. -%{mnesia_consistency_test, consistency_after_add_replica_2_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_add_replica_2_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_add_replica_2_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_add_replica_3_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_add_replica_3_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_add_replica_3_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_del_replica_2_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_del_replica_2_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_del_replica_2_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_del_replica_3_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_del_replica_3_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_del_replica_3_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_move_replica_2_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_move_replica_2_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_move_replica_2_disc_only, "Uses disc"}}. -%{mnesia_consistency_test, consistency_after_move_replica_3_ram} 'IMPL' -{skip, {mnesia_consistency_test, consistency_after_move_replica_3_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_move_replica_3_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_transform_table, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_change_table_copy_type, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_2_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_2_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_2_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_3_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_3_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_fallback_3_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_clear_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_clear_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_clear_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_recreate_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_recreate_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_restore_recreate_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, consistency_after_rename_of_node, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, updates_during_checkpoint_activation, "Uses disk"}}. -%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_2_disc, "Uses disc"}}. -%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_2_disc_only, "Uses disc"}}. -%%{mnesia_consistency_test, updates_during_checkpoint_activation_3_ram} 'IMPL' -%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_3_disc, "Uses disc"}}. -%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_3_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration, "Uses disk"}}. -%{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration_2_disc, "Uses disc"}}. -%{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration_2_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_ram, "Uses disk"}}. -{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_disc, "Uses disc"}}. -{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_disc_only, "Uses disc"}}. -{skip, {mnesia_consistency_test, inst_fallback_process_dies, "Uses disk"}}. -{skip, {mnesia_consistency_test, fatal_when_inconsistency, "Uses disk"}}. -{skip, {mnesia_consistency_test, after_delete, "Uses disk"}}. -{skip, {mnesia_consistency_test, mnesia_down_during_backup_causes_switch, "Uses disk"}}. -{skip, {mnesia_consistency_test, mnesia_down_during_backup_causes_abort, "Uses disk"}}. -%{mnesia_consistency_test, cause_switch_after} 'IMPL' -%{mnesia_consistency_test, cause_abort_before} 'IMPL' -%{mnesia_consistency_test, cause_abort_after} 'IMPL' -%{mnesia_consistency_test, change_schema_before} 'IMPL' -%{mnesia_consistency_test, change_schema_after} 'IMPL' - diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 2267a94164..e0004ecb51 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -105,7 +105,6 @@ groups() -> {otp_r4b, [], [{mnesia_config_test, access_module}, {mnesia_config_test, dump_log_load_regulation}, - {mnesia_config_test, embedded_mnemosyne}, {mnesia_config_test, ignore_fallback_at_startup}, {mnesia_config_test, max_wait_for_decision}, {mnesia_consistency_test, consistency_after_restore}, diff --git a/lib/mnesia/test/mnesia_bench.spec b/lib/mnesia/test/mnesia_bench.spec new file mode 100644 index 0000000000..7b17cb5c4e --- /dev/null +++ b/lib/mnesia/test/mnesia_bench.spec @@ -0,0 +1 @@ +{suites,"../mnesia_test",[mnesia_bench_SUITE]}.
\ No newline at end of file diff --git a/lib/mnesia/test/mnesia_bench_SUITE.erl b/lib/mnesia/test/mnesia_bench_SUITE.erl new file mode 100644 index 0000000000..7cbf77f046 --- /dev/null +++ b/lib/mnesia/test/mnesia_bench_SUITE.erl @@ -0,0 +1,69 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2012. 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% +%% + +%% +-module(mnesia_bench_SUITE). +-author('[email protected]'). +-compile(export_all). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]}]. + + +all() -> + [{group,tpcb}]. + +groups() -> + [{tpcb,[{repeat,2}],[tpcb_conflict_ramcopies, + tpcb_conflict_disk_only_copies]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +init_per_suite(Config) -> + Config. + +end_per_suite(Config) -> + Config. + +init_per_testcase(_Func, Conf) -> + Conf. + +end_per_testcase(_Func, _Conf) -> + ok. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +tpcb_conflict_ramcopies(_Config) -> + mnesia_tpcb:conflict_benchmark(ram_copies). + +tpcb_conflict_disk_only_copies(_Config) -> + mnesia_tpcb:conflict_benchmark(disc_only_copies). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 93510d539c..6baf86a4a5 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-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -36,7 +36,6 @@ dump_log_load_regulation/1, dump_log_update_in_place/1, - embedded_mnemosyne/1, event_module/1, ignore_fallback_at_startup/1, inconsistent_database/1, @@ -104,7 +103,7 @@ end_per_testcase(Func, Conf) -> all() -> [access_module, auto_repair, backup_module, debug, dir, dump_log_load_regulation, {group, dump_log_thresholds}, - dump_log_update_in_place, embedded_mnemosyne, + dump_log_update_in_place, event_module, ignore_fallback_at_startup, inconsistent_database, max_wait_for_decision, send_compressed, app_test, {group, schema_config}, @@ -597,8 +596,8 @@ dump_log_load_regulation(Config) when is_list(Config) -> {n_branches, length(Nodes) * 10}, {n_accounts_per_branch, 5}, {replica_type, disc_copies}, - {stop_after, timer:seconds(30)}, - {report_interval, timer:seconds(10)}, + {stop_after, timer:seconds(15)}, + {report_interval, timer:seconds(3)}, {use_running_mnesia, true}, {reuse_history_id, true}], @@ -610,45 +609,6 @@ dump_log_load_regulation(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -embedded_mnemosyne(doc) -> - ["Start Mnemosyne as an embedded part of Mnesia", - "on some of the nodes"]; -embedded_mnemosyne(suite) -> - []; -embedded_mnemosyne(Config) when is_list(Config) -> - Nodes = ?acquire_nodes(1, Config), - Param = embedded_mnemosyne, - - %% Normal - NoMnem = false, - ?match(NoMnem, mnesia:system_info(Param)), - ?match(undefined, whereis(mnemosyne_catalog)), - ?match([], mnesia_test_lib:stop_mnesia(Nodes)), - - %% Bad - Bad = arne_anka, - ?match({error, {bad_type, Param, Bad}}, - mnesia:start([{Param, Bad}])), - - case code:priv_dir(mnemosyne) of - {error, _} -> %% No mnemosyne on later systems - ok; - _ -> - %% Mnemosyne as embedded application - Mnem = true, - ?match(undefined, whereis(mnemosyne_catalog)), - ?match(ok,mnesia:start([{Param, Mnem}])), - ?match(Mnem, mnesia:system_info(Param)), - ?match(Pid when is_pid(Pid), whereis(mnemosyne_catalog)), - ?match([], mnesia_test_lib:stop_mnesia(Nodes)), - ?match(undefined, whereis(mnemosyne_catalog)) - end, - ?verify_mnesia([], Nodes), - ?cleanup(1, Config), - ok. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - ignore_fallback_at_startup(doc) -> ["Start Mnesia without rollback of the database to the fallback. ", "Once Mnesia has been (re)started the installed fallback should", diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index 2fee72f066..4434abaa1e 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -100,14 +100,14 @@ load_latest_data(Config) when is_list(Config) -> ?match([], mnesia_test_lib:start_mnesia([N1], [])), %% Should wait for N2 - ?match({timeout, [t1]}, rpc:call(N1, mnesia, wait_for_tables, [[t1], 3000])), + ?match({timeout, [t1]}, rpc:call(N1, mnesia, wait_for_tables, [[t1], 1000])), ?match([], mnesia_test_lib:start_mnesia([N3], [])), - ?match({timeout, [t1]}, rpc:call(N1, mnesia, wait_for_tables, [[t1], 3000])), + ?match({timeout, [t1]}, rpc:call(N1, mnesia, wait_for_tables, [[t1], 1000])), ?match([], mnesia_test_lib:start_mnesia([N2], [])), - ?match(ok, rpc:call(N2, mnesia, wait_for_tables, [[t1], 3000])), - ?match(ok, rpc:call(N1, mnesia, wait_for_tables, [[t1], 3000])), + ?match(ok, rpc:call(N2, mnesia, wait_for_tables, [[t1], 10000])), + ?match(ok, rpc:call(N1, mnesia, wait_for_tables, [[t1], 10000])), %% We should find the record ?match([Rec2], rpc:call(N1, mnesia, dirty_read, [t1, test])), ?match([Rec2], rpc:call(N2, mnesia, dirty_read, [t1, test])), @@ -124,12 +124,12 @@ load_latest_data(Config) when is_list(Config) -> ?match([], mnesia_test_lib:start_mnesia([N2], [])), %% Should wait for N1 - ?match({timeout, [t1]}, rpc:call(N2, mnesia, wait_for_tables, [[t1], 2000])), + ?match({timeout, [t1]}, rpc:call(N2, mnesia, wait_for_tables, [[t1], 1000])), ?match([], mnesia_test_lib:start_mnesia([N3], [])), - ?match({timeout, [t1]}, rpc:call(N2, mnesia, wait_for_tables, [[t1], 2000])), + ?match({timeout, [t1]}, rpc:call(N2, mnesia, wait_for_tables, [[t1], 1000])), ?match([], mnesia_test_lib:start_mnesia([N1], [])), - ?match(ok, rpc:call(N2, mnesia, wait_for_tables, [[t1], 1000])), - ?match(ok, rpc:call(N1, mnesia, wait_for_tables, [[t1], 1000])), + ?match(ok, rpc:call(N2, mnesia, wait_for_tables, [[t1], 10000])), + ?match(ok, rpc:call(N1, mnesia, wait_for_tables, [[t1], 10000])), %% We should find the record ?match([Rec1], rpc:call(N1, mnesia, dirty_read, [t1, test])), ?match([Rec1], rpc:call(N2, mnesia, dirty_read, [t1, test])), diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 64b61288ef..db23a39943 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-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -39,7 +39,7 @@ all() -> db_node_lifecycle, evil_delete_db_node, start_and_stop, checkpoint, table_lifecycle, storage_options, add_copy_conflict, - add_copy_when_going_down, replica_management, + add_copy_when_going_down, replica_management, clear_table_during_load, schema_availability, local_content, {group, table_access_modifications}, replica_location, {group, table_sync}, user_properties, unsupp_user_props, @@ -569,7 +569,50 @@ storage_options(Config) when is_list(Config) -> ?verify_mnesia(Nodes, []). +clear_table_during_load(suite) -> []; +clear_table_during_load(doc) -> + ["Clear table caused during load caused a schema entry in the actual tab"]; +clear_table_during_load(Config) when is_list(Config) -> + Nodes = [_, Node2] = ?acquire_nodes(2, Config ++ [{tc_timeout, timer:minutes(2)}]), + ?match({atomic,ok}, mnesia:create_table(cleartab, [{ram_copies, Nodes}])), + Tester = self(), + Bin = <<"Testingasdasd", 0:32000>>, + Fill = fun() -> [mnesia:write({cleartab, N, Bin}) || N <- lists:seq(1, 3000)], ok end, + ?match({atomic, ok}, mnesia:sync_transaction(Fill)), + + StopAndStart = fun() -> + stopped = mnesia:stop(), + Tester ! {self(), stopped}, + receive start_node -> ok end, + ok = mnesia:start(), + ok = mnesia:wait_for_tables([cleartab], 2000), + lists:foreach(fun({cleartab,_,_}) -> ok; + (What) -> Tester ! {failed, What}, + unlink(Tester), + exit(foo) + end, + ets:tab2list(cleartab)), + Tester ! {self(), ok}, + normal + end, + Test = fun(N) -> + Pid = spawn_link(Node2, StopAndStart), + receive {Pid, stopped} -> ok end, + Pid ! start_node, + timer:sleep(N*10), + {atomic, ok} = mnesia:clear_table(cleartab), + receive + {Pid, ok} -> ok; + {failed, What} -> + io:format("Failed in ~p tries, with ~p~n",[N, What]), + exit({error, What}); + {'EXIT', Pid, Reason} -> + exit({died, Reason}) + end + end, + [Test(N) || N <- lists:seq(1, 10)], + ?verify_mnesia(Nodes, []). add_copy_conflict(suite) -> []; @@ -599,7 +642,7 @@ add_copy_conflict(Config) when is_list(Config) -> mnesia_controller:unblock_controller(), ?match_receive({test, {atomic,ok}}), - + ?match(ok, mnesia:wait_for_tables([a,b], 3000)), ?verify_mnesia(Nodes, []), ?cleanup(1, Config). @@ -635,7 +678,7 @@ add_copy_when_going_down(Config) -> end, _Lock = spawn(fun() -> mnesia:transaction(WriteAndWait) end), Tester = self(), - spawn_link(fun() -> Res = rpc:call(Node2,mnesia, add_table_copy, + spawn_link(fun() -> Res = rpc:call(Node2, mnesia, add_table_copy, [a, Node2, ram_copies]), Tester ! {test, Res} end), @@ -1942,6 +1985,10 @@ subscribe_standard(Config) when is_list(Config)-> ?match({atomic, ok}, mnesia:create_table(Tab, Def)), %% Check system events + ?match({error, {badarg, foo}}, mnesia:unsubscribe(foo)), + ?match({error, badarg}, mnesia:unsubscribe({table, foo})), + ?match(_, mnesia:unsubscribe(activity)), + ?match({ok, N1}, mnesia:subscribe(system)), ?match({ok, N1}, mnesia:subscribe(activity)), diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index 373d47a05a..219f358fdb 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -34,32 +34,6 @@ end_per_testcase(Func, Conf) -> delete_schema], N, Config, ?FILE, ?LINE)). -opt_net_load(ExampleMod) -> - opt_net_load([node() | nodes()], ExampleMod, ok). - -opt_net_load([Node | Nodes], ExampleMod, Res) -> - case rpc:call(Node, ?MODULE, opt_load, [ExampleMod]) of - {module, ExampleMod} -> - opt_net_load(Nodes, ExampleMod, Res); - {error, Reason} -> - Error = {opt_net_load, ExampleMod, Node, Reason}, - opt_net_load(Nodes, ExampleMod, {error, Error}); - {badrpc, Reason} -> - Error = {opt_net_load, ExampleMod, Node, Reason}, - opt_net_load(Nodes, ExampleMod, {error, Error}) - end; -opt_net_load([], _ExampleMod, Res) -> - Res. - -opt_load(Mod) -> - case code:is_loaded(Mod) of - {file, _} -> - {module, Mod}; - false -> - Abs = filename:join([code:lib_dir(mnesia), examples, Mod]), - code:load_abs(Abs) - end. - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> [bup, company, meter, {group, tpcb}]. @@ -95,49 +69,49 @@ replica_test(suite) -> []; replica_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(replica_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(replica_test, ram_copies))). sticky_replica_test(suite) -> []; sticky_replica_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(sticky_replica_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(sticky_replica_test, ram_copies))). dist_test(suite) -> []; dist_test(Config) when is_list(Config) -> ?init(3, [{tc_timeout, timer:minutes(10)} | Config]), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(dist_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(dist_test, ram_copies))). conflict_test(suite) -> []; conflict_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(conflict_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(conflict_test, ram_copies))). frag_test(suite) -> []; frag_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(frag_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(frag_test, ram_copies))). frag2_test(suite) -> []; frag2_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(frag2_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(frag2_test, ram_copies))). remote_test(suite) -> []; remote_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(remote_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(remote_test, ram_copies))). remote_frag2_test(suite) -> []; remote_frag2_test(Config) when is_list(Config) -> ?init(3, Config), opt_net_load(mnesia_tpcb), - ?match({ok, _}, mnesia_tpcb:start(mnesia_tpcb:config(remote_frag2_test, ram_copies))). + ?match({ok, _}, mnesia_tpcb:start(config(remote_frag2_test, ram_copies))). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% meter(doc) -> @@ -149,4 +123,37 @@ meter(Config) when is_list(Config) -> opt_net_load(mnesia_meter), ?match(ok, mnesia_meter:go(ram_copies, [N])). +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +config(Test, Type) -> + Config0 = mnesia_tpcb:config(Test, Type), + %% Cut the times, the idea is to test the example and configuration + %% not running the test a long time + Config1 = lists:keyreplace(stop_after, 1, Config0, {stop_after, 6000}), + lists:keyreplace(report_interval, 1, Config1, {report_interval, 1000}). + +opt_net_load(ExampleMod) -> + opt_net_load([node() | nodes()], ExampleMod, ok). + +opt_net_load([Node | Nodes], ExampleMod, Res) -> + case rpc:call(Node, ?MODULE, opt_load, [ExampleMod]) of + {module, ExampleMod} -> + opt_net_load(Nodes, ExampleMod, Res); + {error, Reason} -> + Error = {opt_net_load, ExampleMod, Node, Reason}, + opt_net_load(Nodes, ExampleMod, {error, Error}); + {badrpc, Reason} -> + Error = {opt_net_load, ExampleMod, Node, Reason}, + opt_net_load(Nodes, ExampleMod, {error, Error}) + end; +opt_net_load([], _ExampleMod, Res) -> + Res. +opt_load(Mod) -> + case code:is_loaded(Mod) of + {file, _} -> + {module, Mod}; + false -> + Abs = filename:join([code:lib_dir(mnesia), examples, Mod]), + code:load_abs(Abs) + end. diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index 3273bc4d40..d57f976d1f 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. 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 @@ -613,11 +613,11 @@ unbound2(Config) when is_list(Config) -> ?match_receive({B, continuing}), %% B should now be in lock queue. - A ! continue, - ?match_receive({A, {atomic, ok}}), - ?match_receive({B, {atomic, [{ul,{key,{17,42}},val}]}}), + A ! continue, + ?match_multi_receive([{A, {atomic, ok}}, + {B, {atomic, [{ul,{key,{17,42}},val}]}}]), ok. - + receiver() -> receive {_Pid, begin_trans} -> diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index e63689d83a..8854854570 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -72,8 +72,7 @@ groups() -> resource_consumption_at_full_load]}, {benchmarks, [], [{group, meter}, cost, dbn_meters, - measure_all_api_functions, {group, tpcb}, - mnemosyne_vs_mnesia_kernel]}, + measure_all_api_functions, {group, tpcb}]}, {tpcb, [], [ram_tpcb, disc_tpcb, disc_only_tpcb]}, {meter, [], [ram_meter, disc_meter, disc_only_meter]}]. diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index 625e6e824c..0d0ad32fb0 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -99,21 +99,21 @@ groups() -> async_dirty_post_kill_coord_node, async_dirty_post_kill_coord_pid]}, {asym_trans, [], - [asym_trans_kill_part_ask, - asym_trans_kill_part_commit_vote, - asym_trans_kill_part_pre_commit, - asym_trans_kill_part_log_commit, - asym_trans_kill_part_do_commit, - asym_trans_kill_coord_got_votes, - asym_trans_kill_coord_pid_got_votes, - asym_trans_kill_coord_log_commit_rec, - asym_trans_kill_coord_pid_log_commit_rec, - asym_trans_kill_coord_log_commit_dec, - asym_trans_kill_coord_pid_log_commit_dec, - asym_trans_kill_coord_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_rec_acc_pre_commit_done_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]}, + [asymtrans_part_ask, + asymtrans_part_commit_vote, + asymtrans_part_pre_commit, + asymtrans_part_log_commit, + asymtrans_part_do_commit, + asymtrans_coord_got_votes, + asymtrans_coord_pid_got_votes, + asymtrans_coord_log_commit_rec, + asymtrans_coord_pid_log_commit_rec, + asymtrans_coord_log_commit_dec, + asymtrans_coord_pid_log_commit_dec, + asymtrans_coord_rec_acc_pre_commit_log_commit, + asymtrans_coord_pid_rec_acc_pre_commit_log_commit, + asymtrans_coord_rec_acc_pre_commit_done_commit, + asymtrans_coord_pid_rec_acc_pre_commit_done_commit]}, {after_corrupt_files, [], [after_corrupt_files_decision_log_head, after_corrupt_files_decision_log_tail, @@ -607,7 +607,7 @@ explicit_stop_during_snmp(Config) when is_list(Config) -> Do_trans_Pid1 = spawn_link(Node2, ?MODULE, do_trans_loop, [Tab, self()]), Do_trans_Pid2 = spawn_link(?MODULE, do_trans_loop, [Tab, self()]), - Start_stop_Pid = spawn_link(?MODULE, start_stop, [Node1, 10, self()]), + Start_stop_Pid = spawn_link(?MODULE, start_stop, [Node1, 5, self()]), receive test_done -> ok @@ -631,13 +631,13 @@ do_trans_loop2(Tab, Father) -> end, case mnesia:transaction(Trans) of {atomic, ok} -> - timer:sleep(200), + timer:sleep(100), do_trans_loop2(Tab, Father); {aborted, {node_not_running, N}} when N == node() -> - timer:sleep(200), + timer:sleep(100), do_trans_loop2(Tab, Father); {aborted, {no_exists, Tab}} -> - timer:sleep(200), + timer:sleep(100), do_trans_loop2(Tab, Father); Else -> ?error("Transaction failed: ~p ~n", [Else]), @@ -649,9 +649,9 @@ start_stop(_Node1, 0, Father) -> Father ! test_done, exit(shutdown); start_stop(Node1, N, Father) when N > 0-> - timer:sleep(timer:seconds(5)), - ?match(stopped, rpc:call(Node1, mnesia, stop, [])), timer:sleep(timer:seconds(2)), + ?match(stopped, rpc:call(Node1, mnesia, stop, [])), + timer:sleep(timer:seconds(1)), ?match([], mnesia_test_lib:start_mnesia([Node1])), start_stop(Node1, N-1, Father). @@ -978,8 +978,8 @@ do_async_dirty([Tab], _Fahter) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -asym_trans_kill_part_ask(suite) -> []; -asym_trans_kill_part_ask(Config) when is_list(Config) -> +asymtrans_part_ask(suite) -> []; +asymtrans_part_ask(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -989,8 +989,8 @@ asym_trans_kill_part_ask(Config) when is_list(Config) -> kill_after_debug_point(Part1, {Part1, {mnesia_tm, doit_ask_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_part_commit_vote(suite) -> []; -asym_trans_kill_part_commit_vote(Config) when is_list(Config) -> +asymtrans_part_commit_vote(suite) -> []; +asymtrans_part_commit_vote(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1000,8 +1000,8 @@ asym_trans_kill_part_commit_vote(Config) when is_list(Config) -> kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, vote_yes}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_part_pre_commit(suite) -> []; -asym_trans_kill_part_pre_commit(Config) when is_list(Config) -> +asymtrans_part_pre_commit(suite) -> []; +asymtrans_part_pre_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1011,8 +1011,8 @@ asym_trans_kill_part_pre_commit(Config) when is_list(Config) -> kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, pre_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_part_log_commit(suite) -> []; -asym_trans_kill_part_log_commit(Config) when is_list(Config) -> +asymtrans_part_log_commit(suite) -> []; +asymtrans_part_log_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1022,8 +1022,8 @@ asym_trans_kill_part_log_commit(Config) when is_list(Config) -> kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, log_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_part_do_commit(suite) -> []; -asym_trans_kill_part_do_commit(Config) when is_list(Config) -> +asymtrans_part_do_commit(suite) -> []; +asymtrans_part_do_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1033,8 +1033,8 @@ asym_trans_kill_part_do_commit(Config) when is_list(Config) -> kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, do_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_got_votes(suite) -> []; -asym_trans_kill_coord_got_votes(Config) when is_list(Config) -> +asymtrans_coord_got_votes(suite) -> []; +asymtrans_coord_got_votes(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1044,8 +1044,8 @@ asym_trans_kill_coord_got_votes(Config) when is_list(Config) -> kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_got_votes}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_pid_got_votes(suite) -> []; -asym_trans_kill_coord_pid_got_votes(Config) when is_list(Config) -> +asymtrans_coord_pid_got_votes(suite) -> []; +asymtrans_coord_pid_got_votes(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1055,8 +1055,8 @@ asym_trans_kill_coord_pid_got_votes(Config) when is_list(Config) -> kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_got_votes}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_log_commit_rec(suite) -> []; -asym_trans_kill_coord_log_commit_rec(Config) when is_list(Config) -> +asymtrans_coord_log_commit_rec(suite) -> []; +asymtrans_coord_log_commit_rec(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1066,8 +1066,8 @@ asym_trans_kill_coord_log_commit_rec(Config) when is_list(Config) -> kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_log_commit_rec}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_pid_log_commit_rec(suite) -> []; -asym_trans_kill_coord_pid_log_commit_rec(Config) when is_list(Config) -> +asymtrans_coord_pid_log_commit_rec(suite) -> []; +asymtrans_coord_pid_log_commit_rec(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1077,8 +1077,8 @@ asym_trans_kill_coord_pid_log_commit_rec(Config) when is_list(Config) -> kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_log_commit_rec}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_log_commit_dec(suite) -> []; -asym_trans_kill_coord_log_commit_dec(Config) when is_list(Config) -> +asymtrans_coord_log_commit_dec(suite) -> []; +asymtrans_coord_log_commit_dec(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1088,8 +1088,8 @@ asym_trans_kill_coord_log_commit_dec(Config) when is_list(Config) -> kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_log_commit_dec}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_pid_log_commit_dec(suite) -> []; -asym_trans_kill_coord_pid_log_commit_dec(Config) when is_list(Config) -> +asymtrans_coord_pid_log_commit_dec(suite) -> []; +asymtrans_coord_pid_log_commit_dec(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1099,8 +1099,8 @@ asym_trans_kill_coord_pid_log_commit_dec(Config) when is_list(Config) -> kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_log_commit_dec}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_rec_acc_pre_commit_log_commit(suite) -> []; -asym_trans_kill_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config) -> +asymtrans_coord_rec_acc_pre_commit_log_commit(suite) -> []; +asymtrans_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1110,8 +1110,8 @@ asym_trans_kill_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config) kill_after_debug_point(Coord, {Coord, {mnesia_tm, rec_acc_pre_commit_log_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(suite) -> []; -asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Config) -> +asymtrans_coord_pid_rec_acc_pre_commit_log_commit(suite) -> []; +asymtrans_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1121,8 +1121,8 @@ asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Con kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, rec_acc_pre_commit_log_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_rec_acc_pre_commit_done_commit(suite) -> []; -asym_trans_kill_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config) -> +asymtrans_coord_rec_acc_pre_commit_done_commit(suite) -> []; +asymtrans_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, @@ -1132,8 +1132,8 @@ asym_trans_kill_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config kill_after_debug_point(Coord, {Coord, {mnesia_tm, rec_acc_pre_commit_done_commit}}, TransFun, [Tab1, Tab2], Nodes). -asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit(suite) -> []; -asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit(Config) when is_list(Config) -> +asymtrans_coord_pid_rec_acc_pre_commit_done_commit(suite) -> []; +asymtrans_coord_pid_rec_acc_pre_commit_done_commit(Config) when is_list(Config) -> ?is_debug_compiled, Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]), [Coord, Part1, Part2] = Nodes, diff --git a/lib/mnesia/test/mnesia_test_lib.erl b/lib/mnesia/test/mnesia_test_lib.erl index ba5bf84e24..6a51aefdf0 100644 --- a/lib/mnesia/test/mnesia_test_lib.erl +++ b/lib/mnesia/test/mnesia_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2011. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. 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 @@ -272,25 +272,13 @@ slave_start_link(Host, Name, Retries) -> end. starter(Host, Name, Args) -> - case os:type() of - vxworks -> - X = test_server:start_node(Name, slave, [{args,Args}]), - timer:sleep(5000), - X; - _ -> - slave:start(Host, Name, Args) - end. + slave:start(Host, Name, Args). slave_sup() -> process_flag(trap_exit, true), receive {'EXIT', _, _} -> - case os:type() of - vxworks -> - erlang:halt(); - _ -> - ignore - end + ignore end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk index 6d5df448c9..d7a132bc1a 100644 --- a/lib/mnesia/vsn.mk +++ b/lib/mnesia/vsn.mk @@ -1 +1 @@ -MNESIA_VSN = 4.7.1 +MNESIA_VSN = 4.9 |