diff options
Diffstat (limited to 'lib/mnesia')
57 files changed, 682 insertions, 440 deletions
diff --git a/lib/mnesia/doc/src/Makefile b/lib/mnesia/doc/src/Makefile index 39f2b28637..da7a9e9516 100644 --- a/lib/mnesia/doc/src/Makefile +++ b/lib/mnesia/doc/src/Makefile @@ -1,8 +1,8 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2016. All Rights Reserved. -# +# +# Copyright Ericsson AB 1997-2017. All Rights Reserved. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,7 +14,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# +# # %CopyrightEnd% # @@ -44,9 +44,7 @@ XML_REF3_FILES = \ mnesia_registry.xml XML_PART_FILES = \ - part.xml \ - part_notes.xml \ - part_notes_history.xml + part.xml XML_CHAPTER_FILES = \ Mnesia_chap1.xml \ @@ -63,20 +61,12 @@ XML_CHAPTER_FILES = \ BOOK_FILES = book.xml - XML_FILES = \ $(BOOK_FILES) $(XML_CHAPTER_FILES) \ $(XML_PART_FILES) $(XML_REF3_FILES) $(XML_APPLICATION_FILES) GIF_FILES = \ - book.gif \ - company.gif \ - mnesia.gif \ - note.gif \ - notes.gif \ - ref_man.gif \ - user_guide.gif \ - warning.gif + company.gif XML_HTML_FILES = \ notes_history.xml @@ -89,7 +79,7 @@ HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \ $(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html) INFO_FILE = ../../info -EXTRA_FILES = summary.html.src \ +EXTRA_FILES = \ $(DEFAULT_GIF_FILES) \ $(DEFAULT_HTML_FILES) \ $(XML_REF3_FILES:%.xml=$(HTMLDIR)/%.html) \ @@ -102,10 +92,10 @@ HTML_REF_MAN_FILE = $(HTMLDIR)/index.html TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf # ---------------------------------------------------- -# FLAGS +# FLAGS # ---------------------------------------------------- -XML_FLAGS += -DVIPS_FLAGS += +XML_FLAGS += +DVIPS_FLAGS += # ---------------------------------------------------- # Targets @@ -134,11 +124,11 @@ gifs: $(GIF_FILES:%=$(HTMLDIR)/%) $(INDEX_TARGET): $(INDEX_SRC) ../../vsn.mk sed -e 's;%VSN%;$(VSN);' $< > $@ -debug opt: +debug opt: # ---------------------------------------------------- # Release Target -# ---------------------------------------------------- +# ---------------------------------------------------- include $(ERL_TOP)/make/otp_release_targets.mk release_docs_spec: docs diff --git a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc index 37389ce5ae..914e0e509c 100644 --- a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc +++ b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc @@ -327,7 +327,7 @@ <section> <title>Initial Database Content</title> <p>After the insertion of the employee named <c>klacke</c>, - the databse has the following records:</p> + the database has the following records:</p> <marker id="table2_1"></marker> <table> <row> diff --git a/lib/mnesia/doc/src/book.gif b/lib/mnesia/doc/src/book.gif Binary files differdeleted file mode 100644 index 94b3868792..0000000000 --- a/lib/mnesia/doc/src/book.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/company.erl b/lib/mnesia/doc/src/company.erl index 20e3235347..5a3b122394 100644 --- a/lib/mnesia/doc/src/company.erl +++ b/lib/mnesia/doc/src/company.erl @@ -19,7 +19,12 @@ %% -module(company). --compile(export_all). +-export([init/0,insert_emp/3,mk_projs/2,females/0,all_females/0, + g/0,female_bosses/0, raise_females/1, over_write/2, raise/2, + bad_raise/2, get_emps/2, get_emps2/2, filter/2, filter_deps/3, + search_deps/3, bench1/0, dotimes/2, dist_init/0, remove_proj/1, + del_in_projs/1, sync/0, tabs/0, find_male_on_second_floor/0, + panic/1, fill_tables/0]). %0 diff --git a/lib/mnesia/doc/src/company_o.erl b/lib/mnesia/doc/src/company_o.erl index 7300e9d4bb..650b6cdeca 100644 --- a/lib/mnesia/doc/src/company_o.erl +++ b/lib/mnesia/doc/src/company_o.erl @@ -19,7 +19,11 @@ %% -module(company_o). --compile(export_all). + +-export([sinit/0, init/0,insert_emp/3,females/0, + female_bosses/0, raise_females/1, over_write/2, raise/2, + bad_raise/2, get_emps/2, get_emps2/2]). + -import(mnesia, [transaction/1]). diff --git a/lib/mnesia/doc/src/fascicules.xml b/lib/mnesia/doc/src/fascicules.xml deleted file mode 100644 index 37feca543f..0000000000 --- a/lib/mnesia/doc/src/fascicules.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE fascicules SYSTEM "fascicules.dtd"> - -<fascicules> - <fascicule file="part" href="part_frame.html" entry="no"> - User's Guide - </fascicule> - <fascicule file="ref_man" href="ref_man_frame.html" entry="yes"> - Reference Manual - </fascicule> - <fascicule file="part_notes" href="part_notes_frame.html" entry="no"> - Release Notes - </fascicule> - <fascicule file="" href="../../../../doc/print.html" entry="no"> - Off-Print - </fascicule> -</fascicules> - diff --git a/lib/mnesia/doc/src/mnesia.gif b/lib/mnesia/doc/src/mnesia.gif Binary files differdeleted file mode 100644 index fbbabee5aa..0000000000 --- a/lib/mnesia/doc/src/mnesia.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/note.gif b/lib/mnesia/doc/src/note.gif Binary files differdeleted file mode 100644 index 6fffe30419..0000000000 --- a/lib/mnesia/doc/src/note.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/notes.gif b/lib/mnesia/doc/src/notes.gif Binary files differdeleted file mode 100644 index e000cca26a..0000000000 --- a/lib/mnesia/doc/src/notes.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml index 3ca4026190..026c6a89d7 100644 --- a/lib/mnesia/doc/src/notes.xml +++ b/lib/mnesia/doc/src/notes.xml @@ -11,7 +11,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software @@ -39,7 +39,22 @@ thus constitutes one section in this document. The title of each section is the version number of Mnesia.</p> - <section><title>Mnesia 4.15</title> + <section><title>Mnesia 4.15.1</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + General Unicode improvements.</p> + <p> + Own Id: OTP-14462</p> + </item> + </list> + </section> + +</section> + +<section><title>Mnesia 4.15</title> <section><title>Improvements and New Features</title> <list> @@ -891,9 +906,9 @@ </item> </list> </section> - - </section> - + + </section> + <section><title>Mnesia 4.4.13</title> <section><title>Fixed Bugs and Malfunctions</title> @@ -962,7 +977,7 @@ </section> <section><title>Mnesia 4.4.10</title> - + <section><title>Fixed Bugs and Malfunctions</title> <list> <item> @@ -992,7 +1007,7 @@ </item> </list> </section> - + </section> @@ -1010,7 +1025,7 @@ </item> </list> </section> - + </section> <section><title>Mnesia 4.4.8</title> @@ -1035,7 +1050,7 @@ </item> </list> </section> - + </section> <section><title>Mnesia 4.4.7</title> @@ -1069,7 +1084,7 @@ </section> - <section><title>Mnesia 4.4.6</title> + <section><title>Mnesia 4.4.6</title> <section><title>Fixed Bugs and Malfunctions</title> <list> <item> @@ -1260,9 +1275,4 @@ </section> </section> - <!-- section> - <title>Previous Notes</title> - <p>For information about older versions see <url href="part_notes_history_frame.html">release notes history</url>.</p> - </section --> </chapter> - diff --git a/lib/mnesia/doc/src/part_notes.xml b/lib/mnesia/doc/src/part_notes.xml deleted file mode 100644 index 1e4e4bc60a..0000000000 --- a/lib/mnesia/doc/src/part_notes.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE part SYSTEM "part.dtd"> - -<part xmlns:xi="http://www.w3.org/2001/XInclude"> - <header> - <copyright> - <year>1997</year><year>2016</year> - <holder>Ericsson AB. All Rights Reserved.</holder> - </copyright> - <legalnotice> - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - </legalnotice> - - <title>MNESIA Release Notes</title> - <prepared>Claes Wikström, Hans Nilsson and Håkan Mattsson</prepared> - <docno></docno> - <date>1997-05-27</date> - <rev>1.2</rev> - <file>part_notes.xml</file> - </header> - <description> - <p><em>Mnesia</em> is a Distributed DataBase Management - System (DBMS), appropriate for telecommunications applications and other - Erlang applications which require continuous operation and exhibit soft - real-time properties. </p> - <p>For information about older versions see - <url href="part_notes_history_frame.html">release notes history</url>.</p> - </description> - <xi:include href="notes.xml"/> -</part> - diff --git a/lib/mnesia/doc/src/part_notes_history.xml b/lib/mnesia/doc/src/part_notes_history.xml deleted file mode 100644 index a1c6f5aef0..0000000000 --- a/lib/mnesia/doc/src/part_notes_history.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE part SYSTEM "part.dtd"> - -<part> - <header> - <copyright> - <year>2004</year> - <year>2016</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>MNESIA Release Notes</title> - <prepared>Claes Wikström, Hans Nilsson and Håkan Mattsson</prepared> - <docno></docno> - <date>1997-05-27</date> - <rev>1.2</rev> - <file>part_notes_history.sgml</file> - </header> - <description> - <p><em>Mnesia</em> is a Distributed DataBase Management - System (DBMS), appropriate for telecommunications applications and other - Erlang applications which require continuous operation and exhibit soft - real-time properties. </p> - </description> - <include file="notes_history"></include> -</part> - diff --git a/lib/mnesia/doc/src/ref_man.gif b/lib/mnesia/doc/src/ref_man.gif Binary files differdeleted file mode 100644 index b13c4efd53..0000000000 --- a/lib/mnesia/doc/src/ref_man.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/summary.html.src b/lib/mnesia/doc/src/summary.html.src deleted file mode 100644 index 2941a2f46a..0000000000 --- a/lib/mnesia/doc/src/summary.html.src +++ /dev/null @@ -1 +0,0 @@ -A heavy duty real-time distributed database
\ No newline at end of file diff --git a/lib/mnesia/doc/src/user_guide.gif b/lib/mnesia/doc/src/user_guide.gif Binary files differdeleted file mode 100644 index e6275a803d..0000000000 --- a/lib/mnesia/doc/src/user_guide.gif +++ /dev/null diff --git a/lib/mnesia/doc/src/warning.gif b/lib/mnesia/doc/src/warning.gif Binary files differdeleted file mode 100644 index 96af52360e..0000000000 --- a/lib/mnesia/doc/src/warning.gif +++ /dev/null diff --git a/lib/mnesia/src/mnesia.app.src b/lib/mnesia/src/mnesia.app.src index 6b49fc6c88..c755b4d4b9 100644 --- a/lib/mnesia/src/mnesia.app.src +++ b/lib/mnesia/src/mnesia.app.src @@ -49,4 +49,4 @@ ]}, {applications, [kernel, stdlib]}, {mod, {mnesia_app, []}}, - {runtime_dependencies, ["stdlib-2.0","kernel-3.0","erts-7.0"]}]}. + {runtime_dependencies, ["stdlib-3.4","kernel-5.3","erts-9.0"]}]}. diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl index 3b771e8c5b..b68b2de028 100644 --- a/lib/mnesia/src/mnesia.erl +++ b/lib/mnesia/src/mnesia.erl @@ -2283,9 +2283,9 @@ list_index_plugins([{N,M,F} | T] = Ps, Legend) -> lists:foldl(fun({N1,_,_}, Wa) -> erlang:max(Wa, length(pp_ix_name(N1))) end, 0, Ps)), - io:fwrite(Legend ++ "~-" ++ W ++ "s - ~s:~s~n", + io:fwrite(Legend ++ "~-" ++ W ++ "s - ~s:~ts~n", [pp_ix_name(N), atom_to_list(M), atom_to_list(F)]), - [io:fwrite(Indent ++ "~-" ++ W ++ "s - ~s:~s~n", + [io:fwrite(Indent ++ "~-" ++ W ++ "s - ~s:~ts~n", [pp_ix_name(N1), atom_to_list(M1), atom_to_list(F1)]) || {N1,M1,F1} <- T]. diff --git a/lib/mnesia/src/mnesia_bup.erl b/lib/mnesia/src/mnesia_bup.erl index 3e55deb958..34f16f178b 100644 --- a/lib/mnesia/src/mnesia_bup.erl +++ b/lib/mnesia/src/mnesia_bup.erl @@ -920,7 +920,7 @@ create_dat_files([{schema, Tab, TabDef} | Tail], Ext, LocalTabs) -> ok -> ok; {error, Reason} -> - mnesia_lib:fatal("Cannot rename file ~p -> ~p: ~p~n", + mnesia_lib:fatal("Cannot rename file ~tp -> ~tp: ~tp~n", [TmpFile, DclFile, Reason]) end end @@ -1016,7 +1016,7 @@ disc_only_swap_fun(disc_only_copies, Expunge, Open, Close) -> ok -> ok; {error, Reason} -> - mnesia_lib:fatal("Cannot rename file ~p -> ~p: ~p~n", + mnesia_lib:fatal("Cannot rename file ~tp -> ~tp: ~tp~n", [TmpFile, DatFile, Reason]) end end; diff --git a/lib/mnesia/src/mnesia_checkpoint.erl b/lib/mnesia/src/mnesia_checkpoint.erl index 8659e4622c..2ff77326a9 100644 --- a/lib/mnesia/src/mnesia_checkpoint.erl +++ b/lib/mnesia/src/mnesia_checkpoint.erl @@ -683,14 +683,14 @@ retainer_create(_Cp, R, Tab, Name, Ext = {ext, Alias, Mod}) -> Cs = val({Tab, cstruct}), Mod:load_table(Alias, T, {retainer, create_table}, mnesia_schema:cs2list(Cs)), - dbg_out("Checkpoint retainer created ~p ~p~n", [Name, Tab]), + dbg_out("Checkpoint retainer created ~p ~tp~n", [Name, Tab]), R#retainer{store = {Ext, T}, really_retain = true}; retainer_create(_Cp, R, Tab, Name, disc_only_copies) -> Fname = tab2retainer({Tab, Name}), file:delete(Fname), Args = [{file, Fname}, {type, set}, {keypos, 2}, {repair, false}], {ok, _} = mnesia_lib:dets_sync_open({Tab, Name}, Args), - dbg_out("Checkpoint retainer created ~p ~p~n", [Name, Tab]), + dbg_out("Checkpoint retainer created ~p ~tp~n", [Name, Tab]), R#retainer{store = {dets, {Tab, Name}}, really_retain = true}; retainer_create(Cp, R, Tab, Name, Storage) -> T = ?ets_new_table(mnesia_retainer, [set, public, {keypos, 2}]), @@ -698,7 +698,7 @@ retainer_create(Cp, R, Tab, Name, Storage) -> ReallyR = R#retainer.really_retain, ReallyCp = lists:member(Tab, Overriders), ReallyR2 = prepare_ram_tab(Tab, T, Storage, ReallyR, ReallyCp), - dbg_out("Checkpoint retainer created ~p ~p~n", [Name, Tab]), + dbg_out("Checkpoint retainer created ~p ~tp~n", [Name, Tab]), R#retainer{store = {ets, T}, really_retain = ReallyR2}. %% Copy the dumped table into retainer if needed @@ -849,7 +849,7 @@ retainer_loop(Cp = #checkpoint_args{is_activated=false, name=Name}) -> retainer_loop(Cp#checkpoint_args{iterators = Iters}); {system, From, Msg} -> - dbg_out("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]), + dbg_out("~p got {system, ~p, ~tp}~n", [?MODULE, From, Msg]), sys:handle_system_msg(Msg, From, Cp#checkpoint_args.supervisor, ?MODULE, [], Cp) end; @@ -938,11 +938,11 @@ retainer_loop(Cp = #checkpoint_args{name=Name}) -> retainer_loop(Cp#checkpoint_args{iterators = Iters}); {system, From, Msg} -> - dbg_out("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]), + dbg_out("~p got {system, ~p, ~tp}~n", [?MODULE, From, Msg]), sys:handle_system_msg(Msg, From, Cp#checkpoint_args.supervisor, ?MODULE, [], Cp); Msg -> - dbg_out("~p got ~p~n", [?MODULE, Msg]) + dbg_out("~p got ~tp~n", [?MODULE, Msg]) end. maybe_activate(Cp) diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl index 6b93935cb4..77013489b3 100644 --- a/lib/mnesia/src/mnesia_controller.erl +++ b/lib/mnesia/src/mnesia_controller.erl @@ -446,7 +446,7 @@ try_schedule_late_disc_load(Tabs, Reason, MsgTag) -> [BadNodes]), try_schedule_late_disc_load(Tabs, Reason, MsgTag); {aborted, AbortReason} -> - fatal("Cannot late_load_tables~p: ~p~n", + fatal("Cannot late_load_tables ~tp: ~tp~n", [[Tabs, Reason, MsgTag], AbortReason]) end. @@ -535,7 +535,7 @@ try_merge_schema(Nodes, Told0, UserFun) -> end, try_merge_schema(Nodes, Told, UserFun); {atomic, {"Cannot get cstructs", Node, Reason}} -> - dbg_out("Cannot get cstructs, Node ~p ~p~n", [Node, Reason]), + dbg_out("Cannot get cstructs, Node ~p ~tp~n", [Node, Reason]), timer:sleep(300), % Avoid a endless loop look alike try_merge_schema(Nodes, Told0, UserFun); {aborted, {shutdown, _}} -> %% One of the nodes is going down @@ -826,12 +826,12 @@ handle_call({del_other, Who}, _From, State = #state{others=Others0}) -> {reply, ok, State#state{others=Others}}; handle_call(Msg, _From, State) -> - error("~p got unexpected call: ~p~n", [?SERVER_NAME, Msg]), + error("~p got unexpected call: ~tp~n", [?SERVER_NAME, Msg]), noreply(State). late_disc_load(TabsR, Reason, RemoteLoaders, From, State = #state{loader_queue = LQ, late_loader_queue = LLQ}) -> - verbose("Intend to load tables: ~p~n", [TabsR]), + verbose("Intend to load tables: ~tp~n", [TabsR]), ?eval_debug_fun({?MODULE, late_disc_load}, [{tabs, TabsR}, {reason, Reason}, @@ -1118,7 +1118,7 @@ handle_cast({adopt_orphans, Node, Tabs}, State) -> noreply(State2); handle_cast(Msg, State) -> - error("~p got unexpected cast: ~p~n", [?SERVER_NAME, Msg]), + error("~p got unexpected cast: ~tp~n", [?SERVER_NAME, Msg]), noreply(State). handle_sync_tabs([Tab | Tabs], From) -> @@ -1166,7 +1166,7 @@ handle_info(#dumper_done{worker_pid=Pid, worker_res=Res}, State) -> State3 = opt_start_worker(State2), noreply(State3); true -> - fatal("Dumper failed: ~p~n state: ~p~n", [Res, State]), + fatal("Dumper failed: ~p~n state: ~tp~n", [Res, State]), {stop, fatal, State} end; @@ -1249,7 +1249,7 @@ handle_info(#sender_done{worker_pid=Pid, worker_res=Res}, State) -> true -> %% No need to send any message to the table receiver %% since it will soon get a mnesia_down anyway - fatal("Sender failed: ~p~n state: ~p~n", [Res, State]), + fatal("Sender failed: ~p~n state: ~tp~n", [Res, State]), {stop, fatal, State} end; @@ -1257,7 +1257,7 @@ handle_info({'EXIT', Pid, R}, State) when Pid == State#state.supervisor -> ?SAFE(set(mnesia_status, stopping)), case State#state.dumper_pid of undefined -> - dbg_out("~p was ~p~n", [?SERVER_NAME, R]), + dbg_out("~p was ~tp~n", [?SERVER_NAME, R]), {stop, shutdown, State}; _ -> noreply(State#state{is_stopping = true}) @@ -1266,12 +1266,12 @@ handle_info({'EXIT', Pid, R}, State) when Pid == State#state.supervisor -> handle_info({'EXIT', Pid, R}, State) when Pid == State#state.dumper_pid -> case State#state.dumper_queue of [#schema_commit_lock{}|Workers] -> %% Schema trans crashed or was killed - dbg_out("WARNING: Dumper ~p exited ~p~n", [Pid, R]), + dbg_out("WARNING: Dumper ~p exited ~tp~n", [Pid, R]), State2 = State#state{dumper_queue = Workers, dumper_pid = undefined}, State3 = opt_start_worker(State2), noreply(State3); _Other -> - fatal("Dumper or schema commit crashed: ~p~n state: ~p~n", [R, State]), + fatal("Dumper or schema commit crashed: ~p~n state: ~tp~n", [R, State]), {stop, fatal, State} end; @@ -1280,15 +1280,15 @@ handle_info(Msg = {'EXIT', Pid, R}, State) when R /= wait_for_tables_timeout -> true -> %% No need to send any message to the table receiver %% since it will soon get a mnesia_down anyway - fatal("Sender crashed: ~p~n state: ~p~n", [{Pid,R}, State]), + fatal("Sender crashed: ~p~n state: ~tp~n", [{Pid,R}, State]), {stop, fatal, State}; false -> case lists:keymember(Pid, 1, get_loaders(State)) of true -> - fatal("Loader crashed: ~p~n state: ~p~n", [R, State]), + fatal("Loader crashed: ~p~n state: ~tp~n", [R, State]), {stop, fatal, State}; false -> - error("~p got unexpected info: ~p~n", [?SERVER_NAME, Msg]), + error("~p got unexpected info: ~tp~n", [?SERVER_NAME, Msg]), noreply(State) end end; @@ -1308,7 +1308,7 @@ handle_info({'EXIT', Pid, wait_for_tables_timeout}, State) -> noreply(State); handle_info(Msg, State) -> - error("~p got unexpected info: ~p~n", [?SERVER_NAME, Msg]), + error("~p got unexpected info: ~tp~n", [?SERVER_NAME, Msg]), noreply(State). sync_tab_timeout(Pid, [{{sync_tab, Tab}, Pids} | Tail]) -> @@ -2054,7 +2054,7 @@ opt_start_sender2([Sender|R], Pids, Kept, LoaderQ) -> Pid = spawn_link(?MODULE, send_and_reply,[self(), Sender]), opt_start_sender2(R,[{Pid,Sender}|Pids],Kept,LoaderQ); true -> - verbose("Send table failed ~p not active on this node ~n", [Tab]), + verbose("Send table failed ~tp not active on this node ~n", [Tab]), Sender#send_table.receiver_pid ! {copier_done, node()}, opt_start_sender2(R,Pids, Kept, LoaderQ) end. @@ -2239,7 +2239,7 @@ disc_load_table(Tab, Reason, ReplyTo) -> Done#loader_done{is_loaded = false, reply = Res}; true -> - fatal("Cannot load table ~p from disc: ~p~n", [Tab, Res]) + fatal("Cannot load table ~tp from disc: ~tp~n", [Tab, Res]) end. filter_active(Tab) -> diff --git a/lib/mnesia/src/mnesia_dumper.erl b/lib/mnesia/src/mnesia_dumper.erl index eb02a585a6..f0ed7aef4a 100644 --- a/lib/mnesia/src/mnesia_dumper.erl +++ b/lib/mnesia/src/mnesia_dumper.erl @@ -193,7 +193,7 @@ do_perform_dump(Cont, InPlace, InitBy, Regulator, OldVersion) -> do_perform_dump(C2, InPlace, InitBy, Regulator, Version) catch _:R when R =/= fatal -> ST = erlang:get_stacktrace(), - Reason = {"Transaction log dump error: ~p~n", [{R, ST}]}, + Reason = {"Transaction log dump error: ~tp~n", [{R, ST}]}, close_files(InPlace, {error, Reason}, InitBy), exit(Reason) end; @@ -329,7 +329,7 @@ perform_update(Tid, SchemaOps, _DumperMode, _UseDir) -> ST = erlang:get_stacktrace(), Error = {error, {"Schema update error", {Reason, ST}}}, close_files(InPlace, Error, InitBy), - fatal("Schema update error ~p ~p", [{Reason,ST}, SchemaOps]) + fatal("Schema update error ~tp ~tp", [{Reason,ST}, SchemaOps]) end. insert_ops(_Tid, _Storage, [], _InPlace, _InitBy, _) -> ok; @@ -1166,7 +1166,7 @@ needs_dump_ets(Tab) -> DcdF = mnesia_lib:tab2dcd(Tab), case file:read_file_info(DcdF) of {error, Reason} -> - mnesia_lib:dbg_out("File ~p info_error ~p ~n", + mnesia_lib:dbg_out("File ~tp info_error ~tp ~n", [DcdF, Reason]), true; {ok, DcdInfo} -> @@ -1205,7 +1205,7 @@ prepare_open(Tab, UpdateInPlace) -> Tmp = mnesia_lib:tab2tmp(Tab), try ok = mnesia_lib:copy_file(Dat, Tmp) catch error:Error -> - fatal("Cannot copy dets file ~p to ~p: ~p~n", + fatal("Cannot copy dets file ~tp to ~tp: ~tp~n", [Dat, Tmp, Error]) end, Tmp @@ -1441,7 +1441,7 @@ start_regulator() -> {ok, Pid} -> Pid; {error, Reason} -> - fatal("Failed to start ~n: ~p~n", [N, Reason]) + fatal("Failed to start ~n: ~tp~n", [N, Reason]) end end. diff --git a/lib/mnesia/src/mnesia_event.erl b/lib/mnesia/src/mnesia_event.erl index b06043bc61..49b3990086 100644 --- a/lib/mnesia/src/mnesia_event.erl +++ b/lib/mnesia/src/mnesia_event.erl @@ -103,11 +103,11 @@ handle_any_event({mnesia_system_event, Event}, State) -> handle_any_event({mnesia_table_event, Event}, State) -> handle_table_event(Event, State); handle_any_event(Msg, State) -> - report_error("~p got unexpected event: ~p~n", [?MODULE, Msg]), + report_error("~p got unexpected event: ~tp~n", [?MODULE, Msg]), {ok, State}. handle_table_event({Oper, Record, TransId}, State) -> - report_info("~p performed by ~p on record:~n\t~p~n", + report_info("~p performed by ~p on record:~n\t~tp~n", [Oper, TransId, Record]), {ok, State}. @@ -155,7 +155,7 @@ handle_system_event({mnesia_down, Node}, State) -> end; handle_system_event({mnesia_overload, Details}, State) -> - report_warning("Mnesia is overloaded: ~w~n", [Details]), + report_warning("Mnesia is overloaded: ~tw~n", [Details]), {ok, State}; handle_system_event({mnesia_info, Format, Args}, State) -> @@ -175,16 +175,16 @@ handle_system_event({mnesia_fatal, Format, Args, BinaryCore}, State) -> {ok, State#state{dumped_core = true}}; handle_system_event({inconsistent_database, Reason, Node}, State) -> - report_error("mnesia_event got {inconsistent_database, ~w, ~w}~n", + report_error("mnesia_event got {inconsistent_database, ~tw, ~w}~n", [Reason, Node]), {ok, State}; handle_system_event({mnesia_user, Event}, State) -> - report_info("User event: ~p~n", [Event]), + report_info("User event: ~tp~n", [Event]), {ok, State}; handle_system_event(Msg, State) -> - report_error("mnesia_event got unexpected system event: ~p~n", [Msg]), + report_error("mnesia_event got unexpected system event: ~tp~n", [Msg]), {ok, State}. report_info(Format0, Args0) -> diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl index c79f790973..d121bd01e9 100644 --- a/lib/mnesia/src/mnesia_index.erl +++ b/lib/mnesia/src/mnesia_index.erl @@ -420,7 +420,7 @@ make_ram_index(Tab, Storage, [Pos | Tail]) -> add_ram_index(Tab, Storage, {Pos, _Pref}) -> Type = ordered, - verbose("Creating index for ~w ~p ~p~n", [Tab, Pos, Type]), + verbose("Creating index for ~tw ~p ~p~n", [Tab, Pos, Type]), SetOrBag = val({Tab, setorbag}), IxValsF = index_vals_f(Storage, Tab, Pos), IxFun = fun(Val, Key) -> {{Val, Key}} end, diff --git a/lib/mnesia/src/mnesia_late_loader.erl b/lib/mnesia/src/mnesia_late_loader.erl index e273329ffc..e4f8dcf2b9 100644 --- a/lib/mnesia/src/mnesia_late_loader.erl +++ b/lib/mnesia/src/mnesia_late_loader.erl @@ -87,13 +87,13 @@ loop(State) -> loop(State); {system, From, Msg} -> - mnesia_lib:dbg_out("~p got {system, ~p, ~p}~n", + mnesia_lib:dbg_out("~p got {system, ~p, ~tp}~n", [?SERVER_NAME, From, Msg]), Parent = State#state.supervisor, sys:handle_system_msg(Msg, From, Parent, ?MODULE, [], State); Msg -> - mnesia_lib:error("~p got unexpected message: ~p~n", + mnesia_lib:error("~p got unexpected message: ~tp~n", [?SERVER_NAME, Msg]), loop(State) end. diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl index 1fdc656600..53fdd76de8 100644 --- a/lib/mnesia/src/mnesia_lib.erl +++ b/lib/mnesia/src/mnesia_lib.erl @@ -467,7 +467,7 @@ pr_other(Var) -> no -> {node_not_running, node()}; _ -> {no_exists, Var} end, - verbose("~p (~p) val(mnesia_gvar, ~w) -> ~p ~p ~n", + verbose("~p (~tp) val(mnesia_gvar, ~tw) -> ~p ~tp ~n", [self(), process_info(self(), registered_name), Var, Why, erlang:get_stacktrace()]), mnesia:abort(Why). @@ -654,7 +654,7 @@ coredump() -> coredump(CrashInfo) -> Core = mkcore(CrashInfo), Out = core_file(), - important("Writing Mnesia core to file: ~p...~p~n", [Out, CrashInfo]), + important("Writing Mnesia core to file: ~tp...~tp~n", [Out, CrashInfo]), _ = file:write_file(Out, Core), Out. @@ -844,7 +844,7 @@ vcore() -> case file:list_dir(Cwd) of {ok, Files}-> CoreFiles = lists:sort(lists:zf(Filter, Files)), - show("Mnesia core files: ~p~n", [CoreFiles]), + show("Mnesia core files: ~tp~n", [CoreFiles]), vcore(lists:last(CoreFiles)); Error -> Error @@ -853,17 +853,17 @@ vcore() -> vcore(Bin) when is_binary(Bin) -> Core = binary_to_term(Bin), Fun = fun({Item, Info}) -> - show("***** ~p *****~n", [Item]), + show("***** ~tp *****~n", [Item]), case catch vcore_elem({Item, Info}) of {'EXIT', Reason} -> - show("{'EXIT', ~p}~n", [Reason]); + show("{'EXIT', ~tp}~n", [Reason]); _ -> ok end end, lists:foreach(Fun, Core); vcore(File) -> - show("~n***** Mnesia core: ~p *****~n", [File]), + show("~n***** Mnesia core: ~tp *****~n", [File]), case file:read_file(File) of {ok, Bin} -> vcore(Bin); @@ -879,7 +879,7 @@ vcore_elem({schema_file, {ok, B}}) -> vcore_elem({logfile, {ok, BinList}}) -> Fun = fun({F, Info}) -> - show("----- logfile: ~p -----~n", [F]), + show("----- logfile: ~tp -----~n", [F]), case Info of {ok, B} -> Fname = "/tmp/mnesia_vcore_elem.TMP", @@ -887,7 +887,7 @@ vcore_elem({logfile, {ok, BinList}}) -> mnesia_log:view(Fname), file:delete(Fname); _ -> - show("~p~n", [Info]) + show("~tp~n", [Info]) end end, lists:foreach(Fun, BinList); @@ -895,12 +895,12 @@ vcore_elem({logfile, {ok, BinList}}) -> vcore_elem({crashinfo, {Format, Args}}) -> show(Format, Args); vcore_elem({gvar, L}) -> - show("~p~n", [lists:sort(L)]); + show("~tp~n", [lists:sort(L)]); vcore_elem({transactions, Info}) -> mnesia_tm:display_info(user, Info); vcore_elem({_Item, Info}) -> - show("~p~n", [Info]). + show("~tp~n", [Info]). fix_error(X) -> set(last_error, X), %% for debugabililty @@ -1018,7 +1018,7 @@ report_system_event({'EXIT', Reason}, Event) -> end; Error -> - Msg = "Mnesia(~p): Cannot report event ~p: ~p (~p)~n", + Msg = "Mnesia(~tp): Cannot report event ~tp: ~tp (~tp)~n", error_logger:format(Msg, [node(), Event, Reason, Error]) end, ok; diff --git a/lib/mnesia/src/mnesia_loader.erl b/lib/mnesia/src/mnesia_loader.erl index c710470a2c..4c6336cb73 100644 --- a/lib/mnesia/src/mnesia_loader.erl +++ b/lib/mnesia/src/mnesia_loader.erl @@ -46,7 +46,7 @@ val(Var) -> disc_load_table(Tab, Reason) -> Storage = val({Tab, storage_type}), Type = val({Tab, setorbag}), - dbg_out("Getting table ~p (~p) from disc: ~p~n", + dbg_out("Getting table ~tp (~p) from disc: ~tp~n", [Tab, Storage, Reason]), ?eval_debug_fun({?MODULE, do_get_disc_copy}, [{tab, Tab}, @@ -56,7 +56,7 @@ disc_load_table(Tab, Reason) -> do_get_disc_copy2(Tab, Reason, Storage, Type). do_get_disc_copy2(Tab, _Reason, Storage, _Type) when Storage == unknown -> - verbose("Local table copy of ~p has recently been deleted, ignored.~n", + verbose("Local table copy of ~tp has recently been deleted, ignored.~n", [Tab]), {not_loaded, storage_unknown}; do_get_disc_copy2(Tab, Reason, Storage, Type) when Storage == disc_copies -> @@ -199,20 +199,20 @@ net_load_table(Tab, Reason, Ns, _Cs) -> try_net_load_table(Tab, Reason, Ns, val({Tab, cstruct})). try_net_load_table(Tab, _Reason, [], _Cs) -> - verbose("Copy failed. No active replicas of ~p are available.~n", [Tab]), + verbose("Copy failed. No active replicas of ~tp are available.~n", [Tab]), {not_loaded, none_active}; try_net_load_table(Tab, Reason, Ns, Cs) -> Storage = mnesia_lib:cs_to_storage_type(node(), Cs), do_get_network_copy(Tab, Reason, Ns, Storage, Cs). do_get_network_copy(Tab, _Reason, _Ns, unknown, _Cs) -> - verbose("Local table copy of ~p has recently been deleted, ignored.~n", [Tab]), + verbose("Local table copy of ~tp has recently been deleted, ignored.~n", [Tab]), {not_loaded, storage_unknown}; do_get_network_copy(Tab, Reason, Ns, Storage, Cs) -> [Node | Tail] = Ns, case lists:member(Node,val({current, db_nodes})) of true -> - dbg_out("Getting table ~p (~p) from node ~p: ~p~n", + dbg_out("Getting table ~tp (~p) from node ~p: ~tp~n", [Tab, Storage, Node, Reason]), ?eval_debug_fun({?MODULE, do_get_network_copy}, [{tab, Tab}, {reason, Reason}, @@ -222,7 +222,7 @@ do_get_network_copy(Tab, Reason, Ns, Storage, Cs) -> set({Tab, load_node}, Node), set({Tab, load_reason}, Reason), mnesia_controller:i_have_tab(Tab), - dbg_out("Table ~p copied from ~p to ~p~n", [Tab, Node, node()]), + dbg_out("Table ~tp copied from ~p to ~p~n", [Tab, Node, node()]), {loaded, ok}; Err = {error, _} when element(1, Reason) == dumper -> {not_loaded,Err}; @@ -286,12 +286,12 @@ init_receiver(Node, Tab,Storage,Cs,Reason) -> element(1,Reason) == dumper -> {error,Result}; {atomic, {error,Result}} -> - fatal("Cannot create table ~p: ~p~n", + fatal("Cannot create table ~tp: ~tp~n", [[Tab, Storage], Result]); {atomic, Result} -> Result; {aborted, nomore} -> restart; {aborted, _Reas} -> - verbose("Receiver failed on ~p from ~p:~nReason: ~p~n", + verbose("Receiver failed on ~tp from ~p:~nReason: ~tp~n", [Tab,Node,_Reas]), down %% either this node or sender is dying end, @@ -313,7 +313,7 @@ start_remote_sender(Node,Tab,Storage) -> {SenderPid, TabSize, DetsData}; %% Protocol conversion hack {copier_done, Node} -> - verbose("Sender of table ~p crashed on node ~p ~n", [Tab, Node]), + verbose("Sender of table ~tp crashed on node ~p ~n", [Tab, Node]), down(Tab, Storage) end. @@ -374,7 +374,7 @@ do_init_table(Tab,Storage,Cs,SenderPid, tab_receiver(Node,Tab,Storage,Cs,OrigTabRec); Reason -> Msg = "[d]ets:init table failed", - verbose("~s: ~p: ~p~n", [Msg, Tab, Reason]), + verbose("~ts: ~tp: ~tp~n", [Msg, Tab, Reason]), down(Tab, Storage) end; Error -> @@ -432,7 +432,7 @@ tab_receiver(Node, Tab, Storage, Cs, OrigTabRec) -> %% Protocol conversion hack {copier_done, Node} -> - verbose("Sender of table ~p crashed on node ~p ~n", [Tab, Node]), + verbose("Sender of table ~tp crashed on node ~p ~n", [Tab, Node]), down(Tab, Storage); {'EXIT', Pid, Reason} -> @@ -490,7 +490,7 @@ ext_load_table(Mod, Alias, Tab, Reason) -> ext_init_table(Action, Alias, Mod, Tab, Fun, State, Sender) -> case Fun(Action) of {copier_done, Node} -> - verbose("Receiver of table ~p crashed on ~p (more)~n", [Tab, Node]), + verbose("Receiver of table ~tp crashed on ~p (more)~n", [Tab, Node]), down(Tab, {ext,Alias,Mod}); {Data, NewFun} -> case Mod:receive_data(Data, Alias, Tab, Sender, State) of @@ -553,7 +553,7 @@ finish_copy(Storage,Tab,Cs,SenderPid,DatBin,OrigTabRec) -> ok; {error, Reason} -> Msg = "Failed to handle last", - verbose("~s: ~p: ~p~n", [Msg, Tab, Reason]), + verbose("~ts: ~tp: ~tp~n", [Msg, Tab, Reason]), down(Tab, Storage) end. @@ -859,7 +859,7 @@ send_more(Pid, N, Chunk, DataState, Tab, Storage) -> send_more(Pid, 1, NewChunk, Init(), Tab, Storage); {copier_done, Node} when Node == node(Pid)-> - verbose("Receiver of table ~p crashed on ~p (more)~n", [Tab, Node]), + verbose("Receiver of table ~tp crashed on ~p (more)~n", [Tab, Node]), throw(receiver_died) end. @@ -937,7 +937,7 @@ finish_copy(Pid, Tab, Storage, RemoteS, NeedLock) -> {Pid, no_more} -> % Dont bother about the spurious 'more' message no_more; {copier_done, Node} -> - verbose("Tab receiver ~p crashed (more): ~p~n", [Tab, Node]), + verbose("Tab receiver ~tp crashed (more): ~p~n", [Tab, Node]), receiver_died end end, diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl index 59fd89059f..073b48abc0 100644 --- a/lib/mnesia/src/mnesia_locker.erl +++ b/lib/mnesia/src/mnesia_locker.erl @@ -245,7 +245,7 @@ loop(State) -> do_stop(); {system, From, Msg} -> - verbose("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]), + verbose("~p got {system, ~p, ~tp}~n", [?MODULE, From, Msg]), Parent = State#state.supervisor, sys:handle_system_msg(Msg, From, Parent, ?MODULE, [], State); @@ -254,7 +254,7 @@ loop(State) -> loop(State); Msg -> - error("~p got unexpected message: ~p~n", [?MODULE, Msg]), + error("~p got unexpected message: ~tp~n", [?MODULE, Msg]), loop(State) end. diff --git a/lib/mnesia/src/mnesia_log.erl b/lib/mnesia/src/mnesia_log.erl index 9536effd42..55b1d6e419 100644 --- a/lib/mnesia/src/mnesia_log.erl +++ b/lib/mnesia/src/mnesia_log.erl @@ -310,7 +310,7 @@ verify_no_exists(Fname) -> false -> ok; true -> - fatal("Log file exists: ~p~n", [Fname]) + fatal("Log file exists: ~tp~n", [Fname]) end. open_log(Name, Header, Fname) -> @@ -331,7 +331,7 @@ open_log(Name, Header, Fname, Exists, Repair) -> open_log(Name, Header, Fname, Exists, Repair, Mode) -> Args = [{file, Fname}, {name, Name}, {repair, Repair}, {mode, Mode}], -%% io:format("~p:open_log: ~p ~p~n", [?MODULE, Name, Fname]), +%% io:format("~p:open_log: ~tp ~tp~n", [?MODULE, Name, Fname]), case mnesia_monitor:open_log(Args) of {ok, Log} when Exists == true -> Log; @@ -344,19 +344,19 @@ open_log(Name, Header, Fname, Exists, Repair, Mode) -> write_header(Log, Header), Log; {repaired, Log, _Recover, BadBytes} -> - mnesia_lib:important("Data may be missing, log ~p repaired: Lost ~p bytes~n", + mnesia_lib:important("Data may be missing, log ~tp repaired: Lost ~p bytes~n", [Fname, BadBytes]), Log; {error, Reason = {file_error, _Fname, emfile}} -> - fatal("Cannot open log file ~p: ~p~n", [Fname, Reason]); + fatal("Cannot open log file ~tp: ~tp~n", [Fname, Reason]); {error, Reason} when Repair == true -> file:delete(Fname), - mnesia_lib:important("Data may be missing, Corrupt logfile deleted: ~p, ~p ~n", + mnesia_lib:important("Data may be missing, Corrupt logfile deleted: ~tp, ~tp ~n", [Fname, Reason]), %% Create a new open_log(Name, Header, Fname, false, false, read_write); {error, Reason} -> - fatal("Cannot open log file ~p: ~p~n", [Fname, Reason]) + fatal("Cannot open log file ~tp: ~tp~n", [Fname, Reason]) end. write_header(Log, Header) -> @@ -381,7 +381,7 @@ close_log(Log) -> {error, {read_only_mode, Log}} -> ok; {error, Reason} -> - mnesia_lib:important("Failed syncing ~p to_disk reason ~p ~n", + mnesia_lib:important("Failed syncing ~tp to_disk reason ~tp ~n", [Log, Reason]) end, mnesia_monitor:close_log(Log). @@ -464,13 +464,13 @@ chunk_log(_Log, eof) -> chunk_log(Log, Cont) -> case disk_log:chunk(Log, Cont) of {error, Reason} -> - fatal("Possibly truncated ~p file: ~p~n", + fatal("Possibly truncated ~tp file: ~tp~n", [Log, Reason]); {C2, Chunk, _BadBytes} -> %% Read_only case, should we warn about the bad log file? %% BUGBUG Should we crash if Repair == false ?? %% We got to check this !! - mnesia_lib:important("~p repaired, lost ~p bad bytes~n", [Log, _BadBytes]), + mnesia_lib:important("~tp repaired, lost ~p bad bytes~n", [Log, _BadBytes]), {C2, Chunk}; Other -> Other @@ -505,7 +505,7 @@ prepare_decision_log_dump(false, Prev) -> ok -> prepare_decision_log_dump(true, Prev); {error, Reason} -> - fatal("Cannot rename decision log file ~p -> ~p: ~p~n", + fatal("Cannot rename decision log file ~tp -> ~tp: ~tp~n", [decision_log_file(), Prev, Reason]) end; prepare_decision_log_dump(true, Prev) -> @@ -522,7 +522,7 @@ confirm_decision_log_dump() -> ok -> file:delete(previous_decision_log_file()); {error, Reason} -> - fatal("Cannot confirm decision log dump: ~p~n", + fatal("Cannot confirm decision log dump: ~tp~n", [Reason]) end. @@ -561,7 +561,7 @@ view() -> lists:foreach(fun(F) -> view(F) end, log_files()). view(File) -> - mnesia_lib:show("***** ~p ***** ~n", [File]), + mnesia_lib:show("***** ~tp ***** ~n", [File]), case exists(File) of false -> nolog; @@ -574,25 +574,25 @@ view(File) -> {repaired, _, _, _} -> view_file(start, N); {error, Reason} -> - error("Cannot open log ~p: ~p~n", [File, Reason]) + error("Cannot open log ~tp: ~tp~n", [File, Reason]) end end. view_file(C, Log) -> case disk_log:chunk(Log, C) of {error, Reason} -> - error("** Possibly truncated FILE ~p~n", [Reason]), + error("** Possibly truncated FILE ~tp~n", [Reason]), error; eof -> disk_log:close(Log), eof; {C2, Terms, _BadBytes} -> - dbg_out("Lost ~p bytes in ~p ~n", [_BadBytes, Log]), - lists:foreach(fun(X) -> mnesia_lib:show("~p~n", [X]) end, + dbg_out("Lost ~p bytes in ~tp ~n", [_BadBytes, Log]), + lists:foreach(fun(X) -> mnesia_lib:show("~tp~n", [X]) end, Terms), view_file(C2, Log); {C2, Terms} -> - lists:foreach(fun(X) -> mnesia_lib:show("~p~n", [X]) end, + lists:foreach(fun(X) -> mnesia_lib:show("~tp~n", [X]) end, Terms), view_file(C2, Log) end. @@ -750,12 +750,12 @@ abort_write_fun(B, What, Args) -> abort_write(B, What, Args, Reason) -> Mod = B#backup_args.module, Opaque = B#backup_args.opaque, - dbg_out("Failed to perform backup. M=~p:F=~p:A=~p -> ~p~n", + dbg_out("Failed to perform backup. M=~p:F=~tp:A=~tp -> ~tp~n", [Mod, What, Args, Reason]), try apply(Mod, abort_write, [Opaque]) of {ok, _Res} -> throw({error, Reason}) catch _:Other -> - error("Failed to abort backup. ~p:~p~p -> ~p~n", + error("Failed to abort backup. ~p:~tp~tp -> ~tp~n", [Mod, abort_write, [Opaque], Other]), throw({error, Reason}) end. @@ -802,7 +802,7 @@ select_source(Tab, Name, PrevName) -> {PrevName, retainer}; _ -> %% Do a full backup anyway - dbg_out("Incremental backup escalated to full backup: ~p~n", [Tab]), + dbg_out("Incremental backup escalated to full backup: ~tp~n", [Tab]), {Name, table} end end. diff --git a/lib/mnesia/src/mnesia_monitor.erl b/lib/mnesia/src/mnesia_monitor.erl index 22a24b6dc9..4cfe16dec0 100644 --- a/lib/mnesia/src/mnesia_monitor.erl +++ b/lib/mnesia/src/mnesia_monitor.erl @@ -178,10 +178,10 @@ check_protocol([{Node, {reject, _Mon, Version, Protocol}} | Tail], Protocols) -> [Node, Protocols, Version, Protocol]), check_protocol(Tail, Protocols); check_protocol([{error, _Reason} | Tail], Protocols) -> - dbg_out("~p connect failed error: ~p~n", [?MODULE, _Reason]), + dbg_out("~p connect failed error: ~tp~n", [?MODULE, _Reason]), check_protocol(Tail, Protocols); check_protocol([{badrpc, _Reason} | Tail], Protocols) -> - dbg_out("~p connect failed badrpc: ~p~n", [?MODULE, _Reason]), + dbg_out("~p connect failed badrpc: ~tp~n", [?MODULE, _Reason]), check_protocol(Tail, Protocols); check_protocol([], [Protocol | _Protocols]) -> set(protocol_version, Protocol), @@ -246,10 +246,10 @@ start_proc(Who, Mod, Fun, Args) -> proc_lib:start_link(mnesia_sp, init_proc, Args2, infinity). terminate_proc(Who, R, State) when R /= shutdown, R /= killed -> - fatal("~p crashed: ~p state: ~p~n", [Who, R, State]); + fatal("~p crashed: ~p state: ~tp~n", [Who, R, State]); terminate_proc(Who, Reason, _State) -> - mnesia_lib:verbose("~p terminated: ~p~n", [Who, Reason]), + mnesia_lib:verbose("~p terminated: ~tp~n", [Who, Reason]), ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -294,7 +294,7 @@ init([Parent]) -> {ok, #state{supervisor = Parent}} catch _:Reason -> - mnesia_lib:report_fatal("Bad configuration: ~p~n", [Reason]), + mnesia_lib:report_fatal("Bad configuration: ~tp~n", [Reason]), {stop, {bad_config, Reason}} end. @@ -333,7 +333,7 @@ handle_call({mktab, Tab, Args}, _From, State) -> catch error:ExitReason -> Msg = "Cannot create ets table", Reason = {system_limit, Msg, Tab, Args, ExitReason}, - fatal("~p~n", [Reason]), + fatal("~tp~n", [Reason]), {noreply, State} end; @@ -353,7 +353,7 @@ handle_call({open_dets, Tab, Args}, _From, State) -> {error, Reason} -> Msg = "Cannot open dets table", Error = {error, {Msg, Tab, Args, Reason}}, - fatal("~p~n", [Error]), + fatal("~tp~n", [Error]), {noreply, State} end; @@ -385,7 +385,7 @@ handle_call({reopen_log, Name, Fname, Head}, _From, State) -> {error, Reason} -> Msg = "Cannot rename disk_log file", Error = {error, {Msg, Name, Fname, Head, Reason}}, - fatal("~p~n", [Error]), + fatal("~tp~n", [Error]), {noreply, State} end; @@ -400,7 +400,7 @@ handle_call({close_log, Name}, _From, State) -> {error, Reason} -> Msg = "Cannot close disk_log file", Error = {error, {Msg, Name, Reason}}, - fatal("~p~n", [Error]), + fatal("~tp~n", [Error]), {noreply, State} end; @@ -461,7 +461,7 @@ handle_call(init, _From, State) -> {reply, EarlyNodes, State2}; handle_call(Msg, _From, State) -> - error("~p got unexpected call: ~p~n", [?MODULE, Msg]), + error("~p got unexpected call: ~tp~n", [?MODULE, Msg]), {noreply, State}. accept_protocol(Mon, Version, Protocol, From, State) -> @@ -535,7 +535,7 @@ handle_cast({inconsistent_database, Context, Node}, State) -> {noreply, State}; handle_cast(Msg, State) -> - error("~p got unexpected cast: ~p~n", [?MODULE, Msg]), + error("~p got unexpected cast: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- @@ -572,7 +572,7 @@ handle_info(Msg = {'EXIT',Pid,_}, State) -> %% We have probably got an exit signal from %% disk_log or dets Hint = "Hint: check that the disk still is writable", - fatal("~p got unexpected info: ~p; ~p~n", + fatal("~p got unexpected info: ~tp; ~p~n", [?MODULE, Msg, Hint]) end; @@ -599,13 +599,13 @@ handle_info({disk_log, _Node, Log, Info}, State) -> {truncated, _No} -> ok; _ -> - mnesia_lib:important("Warning Log file ~p error reason ~s~n", + mnesia_lib:important("Warning Log file ~tp error reason ~ts~n", [Log, disk_log:format_error(Info)]) end, {noreply, State}; handle_info(Msg, State) -> - error("~p got unexpected info (~p): ~p~n", [?MODULE, State, Msg]). + error("~p got unexpected info (~tp): ~tp~n", [?MODULE, State, Msg]). process_q(State = #state{mq=[]}) -> {noreply,State}; process_q(State = #state{mq=[{info,Msg}|R]}) -> diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl index b204fb282f..d792070332 100644 --- a/lib/mnesia/src/mnesia_recover.erl +++ b/lib/mnesia/src/mnesia_recover.erl @@ -762,7 +762,7 @@ handle_call(sync, _From, State) -> {reply, ok, State}; handle_call(Msg, _From, State) -> - error("~p got unexpected call: ~p~n", [?MODULE, Msg]), + error("~p got unexpected call: ~tp~n", [?MODULE, Msg]), {noreply, State}. do_log_mnesia_up(Node) -> @@ -881,7 +881,7 @@ handle_cast({log_dump_overload, Flag}, State) when is_boolean(Flag) -> {noreply, State#state{log_dump_overload = Flag}}; handle_cast(Msg, State) -> - error("~p got unexpected cast: ~p~n", [?MODULE, Msg]), + error("~p got unexpected cast: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- @@ -927,11 +927,11 @@ handle_info({force_decision, Tid}, State) -> end; handle_info({'EXIT', Pid, R}, State) when Pid == State#state.supervisor -> - mnesia_lib:dbg_out("~p was ~p~n",[?MODULE, R]), + mnesia_lib:dbg_out("~p was ~tp~n",[?MODULE, R]), {stop, shutdown, State}; handle_info(Msg, State) -> - error("~p got unexpected info: ~p~n", [?MODULE, Msg]), + error("~p got unexpected info: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl index f71ee26d7c..83cc19c678 100644 --- a/lib/mnesia/src/mnesia_schema.erl +++ b/lib/mnesia/src/mnesia_schema.erl @@ -386,7 +386,7 @@ delete_schema(Ns) when is_list(Ns), Ns /= [] -> [] -> ok; BadReplies -> - verbose("~s: ~p~n", [Reason, BadReplies]), + verbose("~s: ~tp~n", [Reason, BadReplies]), {error, {"All nodes not running", BadReplies}} end; {_Replies, BadNs} -> @@ -467,10 +467,10 @@ opt_create_dir(UseDir, Dir) when UseDir == true-> false -> case file:make_dir(Dir) of ok -> - verbose("Create Directory ~p~n", [Dir]), + verbose("Create Directory ~tp~n", [Dir]), ok; {error, Reason} -> - verbose("Cannot create mnesia dir ~p~n", [Reason]), + verbose("Cannot create mnesia dir ~tp~n", [Reason]), {error, {"Cannot create Mnesia dir", Dir, Reason}} end end; @@ -1470,7 +1470,7 @@ verify_backend_type(Name, Module) -> [] -> ok; _Other -> - io:fwrite(user, "Missing backend_type exports: ~p~n", [_Other]), + io:fwrite(user, "Missing backend_type exports: ~tp~n", [_Other]), mnesia:abort({bad_type, {backend_type,Name,Module}}) end. @@ -1776,7 +1776,7 @@ make_del_table_copy(Tab, Node) -> mnesia:abort({combine_error, Tab, "Last replica"}); [] -> ensure_active(Cs), - dbg_out("Last replica deleted in table ~p~n", [Tab]), + dbg_out("Last replica deleted in table ~tp~n", [Tab]), make_delete_table(Tab, whole_table); _ when Tab == schema -> %% ensure_active(Cs2), @@ -2178,13 +2178,13 @@ do_write_table_property(Tab, Prop) -> case change_prop_in_existing_op(Tab, Prop, write_property, Store) of true -> dbg_out("change_prop_in_existing_op" - "(~p,~p,write_property,Store) -> true~n", + "(~tp,~p,write_property,Store) -> true~n", [Tab,Prop]), %% we have merged the table prop into the create_table op ok; false -> dbg_out("change_prop_in_existing_op" - "(~p,~p,write_property,Store) -> false~n", + "(~tp,~p,write_property,Store) -> false~n", [Tab,Prop]), %% this must be an existing table get_tid_ts_and_lock(Tab, none), @@ -2315,13 +2315,13 @@ do_delete_table_property(Tab, PropKey) -> case change_prop_in_existing_op(Tab, PropKey, delete_property, Store) of true -> dbg_out("change_prop_in_existing_op" - "(~p,~p,delete_property,Store) -> true~n", + "(~tp,~p,delete_property,Store) -> true~n", [Tab,PropKey]), %% we have merged the table prop into the create_table op ok; false -> dbg_out("change_prop_in_existing_op" - "(~p,~p,delete_property,Store) -> false~n", + "(~tp,~p,delete_property,Store) -> false~n", [Tab,PropKey]), %% this must be an existing table get_tid_ts_and_lock(Tab, none), @@ -2435,17 +2435,17 @@ prepare_op(_Tid, {op, sync_trans}, {part, CoordPid}) -> {sync_trans, CoordPid} -> {false, optional}; {mnesia_down, _Node} = Else -> - mnesia_lib:verbose("sync_op terminated due to ~p~n", [Else]), + mnesia_lib:verbose("sync_op terminated due to ~tp~n", [Else]), mnesia:abort(Else); {'EXIT', _, _} = Else -> - mnesia_lib:verbose("sync_op terminated due to ~p~n", [Else]), + mnesia_lib:verbose("sync_op terminated due to ~tp~n", [Else]), mnesia:abort(Else) end; prepare_op(_Tid, {op, sync_trans}, {coord, Nodes}) -> case receive_sync(Nodes, []) of {abort, Reason} -> - mnesia_lib:verbose("sync_op terminated due to ~p~n", [Reason]), + mnesia_lib:verbose("sync_op terminated due to ~tp~n", [Reason]), mnesia:abort(Reason); Pids -> [Pid ! {sync_trans, self()} || Pid <- Pids], @@ -2707,7 +2707,7 @@ prepare_op(_Tid, {op, transform, Fun, TabDef}, _WaitFor) -> {true, Objs, mandatory} catch _:Reason -> mnesia_lib:db_fixtable(Storage, Tab, false), - mnesia_lib:important("Transform function failed: '~p' in '~p'", + mnesia_lib:important("Transform function failed: '~tp' in '~tp'", [Reason, erlang:get_stacktrace()]), exit({"Bad transform function", Tab, Fun, node(), Reason}) end @@ -2719,7 +2719,7 @@ prepare_op(_Tid, {op, merge_schema, TabDef}, _WaitFor) -> ok -> {true, optional}; Error -> - verbose("Merge_Schema ~p failed on ~p: ~p~n", [_Tid,node(),Error]), + verbose("Merge_Schema ~p failed on ~p: ~tp~n", [_Tid,node(),Error]), mnesia:abort({bad_commit, Error}) end; prepare_op(_Tid, _Op, _WaitFor) -> @@ -3133,7 +3133,7 @@ ext_real_suffixes(Ext) -> [M || {_,M} <- Ext]) catch error:E -> - verbose("Cant find real ext suffixes (~p)~n", [E]), + verbose("Cant find real ext suffixes (~tp)~n", [E]), [] end. @@ -3142,7 +3142,7 @@ ext_tmp_suffixes(Ext) -> [M || {_,M} <- Ext]) catch error:E -> - verbose("Cant find tmp ext suffixes (~p)~n", [E]), + verbose("Cant find tmp ext suffixes (~tp)~n", [E]), [] end. @@ -3153,14 +3153,14 @@ info() -> info(Tab) -> Props = get_table_properties(Tab), - io:format("-- Properties for ~w table --- ~n",[Tab]), + io:format("-- Properties for ~tw table --- ~n",[Tab]), info2(Tab, Props). info2(Tab, [{cstruct, _V} | Tail]) -> % Ignore cstruct info2(Tab, Tail); info2(Tab, [{frag_hash, _V} | Tail]) -> % Ignore frag_hash info2(Tab, Tail); info2(Tab, [{P, V} | Tail]) -> - io:format("~-20w -> ~p~n",[P,V]), + io:format("~-20tw -> ~tp~n",[P,V]), info2(Tab, Tail); info2(_, []) -> io:format("~n", []). @@ -3726,7 +3726,7 @@ merge_versions(AnythingNew, Cs, RemoteCs, Force) -> ok; true -> Str = io_lib:format("Bad cookies. Cannot merge definitions of " - "table ~w. Local = ~w, Remote = ~w~n", + "table ~tw. Local = ~w, Remote = ~w~n", [Cs#cstruct.name, Cs, RemoteCs]), throw(Str) end, @@ -3746,7 +3746,7 @@ merge_versions(AnythingNew, Cs, RemoteCs, Force) -> do_merge_versions(AnythingNew, Cs, RemoteCs); true -> Str1 = io_lib:format("Cannot merge definitions of " - "table ~w. Local = ~w, Remote = ~w~n", + "table ~tw. Local = ~w, Remote = ~w~n", [Cs#cstruct.name, Cs, RemoteCs]), throw(Str1) end. diff --git a/lib/mnesia/src/mnesia_subscr.erl b/lib/mnesia/src/mnesia_subscr.erl index c2748f5bae..dfaa20d2d3 100644 --- a/lib/mnesia/src/mnesia_subscr.erl +++ b/lib/mnesia/src/mnesia_subscr.erl @@ -264,7 +264,7 @@ handle_call({change, How}, _From, State) -> {reply, Reply, State}; handle_call(Msg, _From, State) -> - error("~p got unexpected call: ~p~n", [?MODULE, Msg]), + error("~p got unexpected call: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- @@ -274,7 +274,7 @@ handle_call(Msg, _From, State) -> %% {stop, Reason, State} (terminate/2 is called) %%---------------------------------------------------------------------- handle_cast(Msg, State) -> - error("~p got unexpected cast: ~p~n", [?MODULE, Msg]), + error("~p got unexpected cast: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- @@ -292,7 +292,7 @@ handle_info({'EXIT', Pid, _Reason}, State) -> {noreply, State}; handle_info(Msg, State) -> - error("~p got unexpected info: ~p~n", [?MODULE, Msg]), + error("~p got unexpected info: ~tp~n", [?MODULE, Msg]), {noreply, State}. %%---------------------------------------------------------------------- diff --git a/lib/mnesia/src/mnesia_text.erl b/lib/mnesia/src/mnesia_text.erl index 21adca813a..7d24d09472 100644 --- a/lib/mnesia/src/mnesia_text.erl +++ b/lib/mnesia/src/mnesia_text.erl @@ -87,18 +87,18 @@ validate_tab(_) -> error(badtab). make_tabs([{Tab, Def} | Tail]) -> try mnesia:table_info(Tab, where_to_read) of Node -> - io:format("** Table ~w already exists on ~p, just entering data~n", + io:format("** Table ~tw already exists on ~p, just entering data~n", [Tab, Node]), make_tabs(Tail) catch exit:_ -> %% non-existing table case mnesia:create_table(Tab, Def) of {aborted, Reason} -> - io:format("** Failed to create table ~w ~n" - "** Reason = ~w, Args = ~p~n", + io:format("** Failed to create table ~tw ~n" + "** Reason = ~tw, Args = ~tp~n", [Tab, Reason, Def]), [Tab | make_tabs(Tail)]; _ -> - io:format("New table ~w~n", [Tab]), + io:format("New table ~tw~n", [Tab]), make_tabs(Tail) end end; @@ -139,12 +139,12 @@ collect_data(Tabs, [{Line, Term} | Tail]) when is_tuple(Term) -> {value, _} -> [Term | collect_data(Tabs, Tail)]; _Other -> - io:format("Object:~p at line ~w unknown\n", [Term,Line]), + io:format("Object:~tp at line ~w unknown\n", [Term,Line]), error(undefined_object) end; collect_data(_Tabs, []) -> []; collect_data(_Tabs, [H|_T]) -> - io:format("Object:~p unknown\n", [H]), + io:format("Object:~tp unknown\n", [H]), error(undefined_object). error(What) -> throw({error, What}). @@ -178,7 +178,7 @@ read_term_from_stream(Stream, File, Line) -> {ok, {Line, Term}, EndLine}; {error, {NewLine,Mod,What}} -> Str = Mod:format_error(What), - io:format("Error in line:~p of:~p ~s\n", + io:format("Error in line:~p of:~tp ~ts\n", [NewLine, File, Str]), error end; diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl index 305bf14bcf..ebf580d09e 100644 --- a/lib/mnesia/src/mnesia_tm.erl +++ b/lib/mnesia/src/mnesia_tm.erl @@ -314,7 +314,7 @@ doit_loop(#state{coordinators=Coordinators,participants=Participants,supervisor= ?eval_debug_fun({?MODULE, do_abort, pre}, [{tid, Tid}]), case gb_trees:lookup(Tid, Participants) of none -> - verbose("Tried to abort a non participant transaction ~p: ~p~n", + verbose("Tried to abort a non participant transaction ~p: ~tp~n", [Tid, Reason]), mnesia_locker:release_tid(Tid), doit_loop(State); @@ -417,7 +417,7 @@ doit_loop(#state{coordinators=Coordinators,participants=Participants,supervisor= {From, {unblock_me, Tab}} -> case lists:member(Tab, State#state.blocked_tabs) of false -> - verbose("Wrong dirty Op blocked on ~p ~p ~p", + verbose("Wrong dirty Op blocked on ~p ~tp ~p", [node(), Tab, From]), reply(From, unblocked), doit_loop(State); @@ -466,11 +466,11 @@ doit_loop(#state{coordinators=Coordinators,participants=Participants,supervisor= end; {system, From, Msg} -> - dbg_out("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]), + dbg_out("~p got {system, ~p, ~tp}~n", [?MODULE, From, Msg]), sys:handle_system_msg(Msg, From, Sup, ?MODULE, [], State); Msg -> - verbose("** ERROR ** ~p got unexpected message: ~p~n", [?MODULE, Msg]), + verbose("** ERROR ** ~p got unexpected message: ~tp~n", [?MODULE, Msg]), doit_loop(State) end. @@ -556,7 +556,7 @@ handle_exit(Pid, Reason, State) -> %% We got exit from a local fool doit_loop(State); {P = #participant{}, _RestP} -> - fatal("Participant ~p in transaction ~p died ~p~n", + fatal("Participant ~p in transaction ~p died ~tp~n", [P#participant.pid, P#participant.tid, Reason]), NewPs = gb_trees:delete(P#participant.tid,State#state.participants), doit_loop(State#state{participants = NewPs}) @@ -598,7 +598,7 @@ recover_coordinator(Tid, Etabs) -> ok %% to the new nested trans store. end catch _:Reason -> - dbg_out("Recovery of coordinator ~p failed:~n", + dbg_out("Recovery of coordinator ~p failed: ~tp~n", [Tid, {Reason, erlang:get_stacktrace()}]), Protocol = asym_trans, tell_outcome(Tid, Protocol, node(), CheckNodes, TellNodes) @@ -941,7 +941,7 @@ decr(_X) -> 0. return_abort(Fun, Args, Reason) -> {_Mod, Tid, Ts} = get(mnesia_activity_state), - dbg_out("Transaction ~p calling ~p with ~p failed: ~n ~p~n", + dbg_out("Transaction ~p calling ~tp with ~tp failed: ~n ~tp~n", [Tid, Fun, Args, Reason]), OldStore = Ts#tidstore.store, Nodes = get_elements(nodes, OldStore), @@ -1714,7 +1714,7 @@ commit_participant(Coord, Tid, Bin, C0, DiscNs, _RamNs) -> mnesia_schema:undo_prepare_commit(Tid, C0); Msg -> - verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~p~n", + verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~tp~n", [Tid, Msg]) end; {Tid, {do_abort, Reason}} -> @@ -1730,7 +1730,7 @@ commit_participant(Coord, Tid, Bin, C0, DiscNs, _RamNs) -> Msg -> reply(Coord, {do_abort, Tid, self(), {bad_commit,internal}}), - verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~p~n", + verbose("** ERROR ** commit_participant ~p, got unexpected msg: ~tp~n", [Tid, Msg]) end catch _:Reason -> @@ -1804,7 +1804,7 @@ do_update(Tid, Storage, [Op | Ops], OldRes) -> %% Determine actual storage type and try again. %% BUGBUG: Updates may be lost if table is transformed. ST = erlang:get_stacktrace(), - verbose("do_update in ~w failed: ~p -> {'EXIT', ~p}~n", + verbose("do_update in ~w failed: ~tp -> {'EXIT', ~tp}~n", [Tid, Op, {Reason, ST}]), do_update(Tid, Storage, Ops, OldRes) end; @@ -1919,7 +1919,7 @@ do_snmp(Tid, [Head|Tail]) -> %% deleted our local replica or recently deattached %% the snmp table ST = erlang:get_stacktrace(), - verbose("do_snmp in ~w failed: ~p -> {'EXIT', ~p}~n", + verbose("do_snmp in ~w failed: ~tp -> {'EXIT', ~tp}~n", [Tid, Head, {Reason, ST}]) end, do_snmp(Tid, Tail). @@ -2151,7 +2151,7 @@ pr_participant(Stream, P) -> true -> Commit0 end, pr_tid(Stream, P#participant.tid), - io:format(Stream, "with participant objects ~p~n", [Commit]). + io:format(Stream, "with participant objects ~tp~n", [Commit]). pr_tid(Stream, Tid) -> @@ -2193,7 +2193,7 @@ search_pr_participant(S, [ P | Tail]) -> true -> Commit0 end, - io:format("~p~n", [Commit]), + io:format("~tp~n", [Commit]), search_pr_participant(S,Tail); %% !!!!! true -> search_pr_participant(S, Tail) @@ -2214,12 +2214,12 @@ display_pid_info(Pid) -> Reds = fetch(reductions, Info), LM = length(fetch(messages, Info)), pformat(io_lib:format("~p", [Pid]), - io_lib:format("~p", [Call]), - io_lib:format("~p", [Curr]), Reds, LM) + io_lib:format("~tp", [Call]), + io_lib:format("~tp", [Curr]), Reds, LM) end. pformat(A1, A2, A3, A4, A5) -> - io:format( "~-12s ~-21s ~-21s ~9w ~4w~n", [A1,A2,A3,A4,A5]). + io:format( "~-12s ~-21ts ~-21ts ~9w ~4w~n", [A1,A2,A3,A4,A5]). fetch(Key, Info) -> case lists:keysearch(Key, 1, Info) of diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 3ec4847c5d..279744dbb0 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -21,7 +21,12 @@ %% -module(mnesia_SUITE). -author('[email protected]'). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_suite/1, end_per_suite/1, + init_per_group/2, end_per_group/2, + suite/0, all/0, groups/0]). +-export([app/1, appup/1, clean_up_suite/1, silly/0]). + -include_lib("common_test/include/ct.hrl"). -include("mnesia_test_lib.hrl"). @@ -92,16 +97,8 @@ groups() -> %% benchmarks {heavy, [], [{group, measure}]}, {measure, [], [{mnesia_measure_test, all}]}, - {prediction, [], - [{group, mnesia_measure_test, prediction}]}, - {fairness, [], - [{group, mnesia_measure_test, fairness}]}, {benchmarks, [], [{group, mnesia_measure_test, benchmarks}]}, - {consumption, [], - [{group, mnesia_measure_test, consumption}]}, - {scalability, [], - [{group, mnesia_measure_test, scalability}]}, %% This test suite is an extract of the grand Mnesia suite %% it contains OTP R4B specific test cases {otp_r4b, [], diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl index cc32ba3826..58a5dc1d40 100644 --- a/lib/mnesia/test/mnesia_atomicity_test.erl +++ b/lib/mnesia/test/mnesia_atomicity_test.erl @@ -22,9 +22,37 @@ -module(mnesia_atomicity_test). -author('[email protected]'). -author('[email protected]'). --compile([export_all]). -include("mnesia_test_lib.hrl"). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). +-export([explicit_abort_in_middle_of_trans/1, + runtime_error_in_middle_of_trans/1, + mnesia_down_during_infinite_trans/1, + kill_self_in_middle_of_trans/1, throw_in_middle_of_trans/1, + lock_waiter_sw_r/1, lock_waiter_sw_rt/1, lock_waiter_sw_wt/1, + lock_waiter_wr_r/1, lock_waiter_srw_r/1, lock_waiter_sw_sw/1, + lock_waiter_sw_w/1, lock_waiter_sw_wr/1, lock_waiter_sw_srw/1, + lock_waiter_wr_wt/1, lock_waiter_srw_wt/1, + lock_waiter_wr_sw/1, lock_waiter_srw_sw/1, lock_waiter_wr_w/1, + lock_waiter_srw_w/1, lock_waiter_r_sw/1, lock_waiter_r_w/1, + lock_waiter_r_wt/1, lock_waiter_rt_sw/1, lock_waiter_rt_w/1, + lock_waiter_rt_wt/1, lock_waiter_wr_wr/1, + lock_waiter_srw_srw/1, lock_waiter_wt_r/1, lock_waiter_wt_w/1, + lock_waiter_wt_rt/1, lock_waiter_wt_wt/1, lock_waiter_wt_wr/1, + lock_waiter_wt_srw/1, lock_waiter_wt_sw/1, lock_waiter_w_wr/1, + lock_waiter_w_srw/1, lock_waiter_w_sw/1, lock_waiter_w_r/1, + lock_waiter_w_w/1, lock_waiter_w_rt/1, lock_waiter_w_wt/1, + restart_r_one/1, restart_w_one/1, restart_rt_one/1, + restart_wt_one/1, restart_wr_one/1, restart_sw_one/1, + restart_r_two/1, restart_w_two/1, restart_rt_two/1, + restart_wt_two/1, restart_wr_two/1, restart_sw_two/1 + ] + ). + +-export([perform_restarted_transaction/1, sync_tid_release/0]). + init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). diff --git a/lib/mnesia/test/mnesia_bench_SUITE.erl b/lib/mnesia/test/mnesia_bench_SUITE.erl index 7c86db383d..5cc01867c4 100644 --- a/lib/mnesia/test/mnesia_bench_SUITE.erl +++ b/lib/mnesia/test/mnesia_bench_SUITE.erl @@ -21,7 +21,13 @@ %% -module(mnesia_bench_SUITE). -author('[email protected]'). --compile(export_all). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_suite/1, end_per_suite/1, + init_per_group/2, end_per_group/2, + suite/0, all/0, groups/0]). + +-export([tpcb_conflict_ramcopies/1, tpcb_conflict_disk_only_copies/1]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]}]. diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl index 2fe1bd34e6..7a2678cee3 100644 --- a/lib/mnesia/test/mnesia_consistency_test.erl +++ b/lib/mnesia/test/mnesia_consistency_test.erl @@ -21,7 +21,78 @@ %% -module(mnesia_consistency_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([consistency_after_change_table_copy_type/1, + consistency_after_rename_of_node/1, + consistency_after_restart_1_ram/1, + consistency_after_restart_1_disc/1, + consistency_after_restart_1_disc_only/1, + consistency_after_restart_2_ram/1, + consistency_after_restart_2_disc/1, + consistency_after_restart_2_disc_only/1, + consistency_after_dump_tables_1_ram/1, + consistency_after_dump_tables_2_ram/1, + consistency_after_add_replica_2_ram/1, + consistency_after_add_replica_2_disc/1, + consistency_after_add_replica_2_disc_only/1, + consistency_after_add_replica_3_ram/1, + consistency_after_add_replica_3_disc/1, + consistency_after_add_replica_3_disc_only/1, + consistency_after_del_replica_2_ram/1, + consistency_after_del_replica_2_disc/1, + consistency_after_del_replica_2_disc_only/1, + consistency_after_del_replica_3_ram/1, + consistency_after_del_replica_3_disc/1, + consistency_after_del_replica_3_disc_only/1, + consistency_after_move_replica_2_ram/1, + consistency_after_move_replica_2_disc/1, + consistency_after_move_replica_2_disc_only/1, + consistency_after_move_replica_3_ram/1, + consistency_after_move_replica_3_disc/1, + consistency_after_move_replica_3_disc_only/1, + consistency_after_transform_table_ram/1, + consistency_after_transform_table_disc/1, + consistency_after_transform_table_disc_only/1, + consistency_after_fallback_2_ram/1, + consistency_after_fallback_2_disc/1, + consistency_after_fallback_2_disc_only/1, + consistency_after_fallback_3_ram/1, + consistency_after_fallback_3_disc/1, + consistency_after_fallback_3_disc_only/1, + consistency_after_restore_clear_ram/1, + consistency_after_restore_clear_disc/1, + consistency_after_restore_clear_disc_only/1, + consistency_after_restore_recreate_ram/1, + consistency_after_restore_recreate_disc/1, + consistency_after_restore_recreate_disc_only/1, + updates_during_checkpoint_activation_1_ram/1, + updates_during_checkpoint_activation_1_disc/1, + updates_during_checkpoint_activation_1_disc_only/1, + updates_during_checkpoint_activation_2_ram/1, + updates_during_checkpoint_activation_2_disc/1, + updates_during_checkpoint_activation_2_disc_only/1, + updates_during_checkpoint_activation_3_ram/1, + updates_during_checkpoint_activation_3_disc/1, + updates_during_checkpoint_activation_3_disc_only/1, + updates_during_checkpoint_iteration_2_ram/1, + updates_during_checkpoint_iteration_2_disc/1, + updates_during_checkpoint_iteration_2_disc_only/1, + load_table_with_activated_checkpoint_ram/1, + load_table_with_activated_checkpoint_disc/1, + load_table_with_activated_checkpoint_disc_only/1, + add_table_copy_to_table_checkpoint_ram/1, + add_table_copy_to_table_checkpoint_disc/1, + add_table_copy_to_table_checkpoint_disc_only/1, + inst_fallback_process_dies/1, fatal_when_inconsistency/1, + after_delete/1,cause_switch_before/1, cause_switch_after/1, + cause_abort_before/1, cause_abort_after/1, + change_schema_before/1, change_schema_after/1]). + +-export([change_tab/3]). -include("mnesia_test_lib.hrl"). diff --git a/lib/mnesia/test/mnesia_cost.erl b/lib/mnesia/test/mnesia_cost.erl index a3fc8dfe20..4d0dd7b0ee 100644 --- a/lib/mnesia/test/mnesia_cost.erl +++ b/lib/mnesia/test/mnesia_cost.erl @@ -20,7 +20,7 @@ %% -module(mnesia_cost). --compile(export_all). +-export([go/0, go/1]). %% This code exercises the mnesia system and produces a bunch %% of measurements on what various things cost @@ -156,64 +156,3 @@ do_dirty(I, F) when I /= 0 -> F(), do_dirty(I-1, F); do_dirty(_,_) -> ok. - - - -table_load([N1,N2| _ ] = Ns) -> - Nodes = [N1,N2], - rpc:multicall(Ns, mnesia, lkill, []), - ok = mnesia:delete_schema(Ns), - ok = mnesia:create_schema(Nodes), - rpc:multicall(Nodes, mnesia, start, []), - TabDef = [{disc_copies,[N1]},{ram_copies,[N2]}, - {attributes,record_info(fields,item)},{record_name,item}], - Tabs = [list_to_atom("tab" ++ integer_to_list(I)) || I <- lists:seq(1,400)], - - [mnesia:create_table(Tab,TabDef) || Tab <- Tabs], - -%% InitTab = fun(Tab) -> -%% mnesia:write_lock_table(Tab), -%% InitRec = fun(Key) -> mnesia:write(Tab,#item{a=Key},write) end, -%% lists:foreach(InitRec, lists:seq(1,100)) -%% end, -%% -%% {Time,{atomic,ok}} = timer:tc(mnesia,transaction, [fun() ->lists:foreach(InitTab, Tabs) end]), - mnesia:dump_log(), -%% io:format("Init took ~p msec ~n", [Time/1000]), - rpc:call(N2, mnesia, stop, []), timer:sleep(1000), - mnesia:stop(), timer:sleep(500), - %% Warmup - ok = mnesia:start([{no_table_loaders, 1}]), - timer:tc(mnesia, wait_for_tables, [Tabs, infinity]), - mnesia:dump_log(), - rpc:call(N2, mnesia, dump_log, []), - io:format("Initialized ~n",[]), - - mnesia:stop(), timer:sleep(1000), - ok = mnesia:start([{no_table_loaders, 1}]), - {T1, ok} = timer:tc(mnesia, wait_for_tables, [Tabs, infinity]), - io:format("Loading from disc with 1 loader ~p msec~n",[T1/1000]), - mnesia:stop(), timer:sleep(1000), - ok = mnesia:start([{no_table_loaders, 4}]), - {T2, ok} = timer:tc(mnesia, wait_for_tables, [Tabs, infinity]), - io:format("Loading from disc with 4 loader ~p msec~n",[T2/1000]), - - %% Warmup - rpc:call(N2, ?MODULE, remote_load, [Tabs,4]), - io:format("Initialized ~n",[]), - - - T3 = rpc:call(N2, ?MODULE, remote_load, [Tabs,1]), - io:format("Loading from net with 1 loader ~p msec~n",[T3/1000]), - - T4 = rpc:call(N2, ?MODULE, remote_load, [Tabs,4]), - io:format("Loading from net with 4 loader ~p msec~n",[T4/1000]), - - ok. - -remote_load(Tabs,Loaders) -> - ok = mnesia:start([{no_table_loaders, Loaders}]), -%% io:format("~p ~n", [mnesia_controller:get_info(500)]), - {Time, ok} = timer:tc(mnesia, wait_for_tables, [Tabs, infinity]), - timer:sleep(1000), mnesia:stop(), timer:sleep(1000), - Time. diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 6d970ac990..92124ebc65 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -21,9 +21,37 @@ %% -module(mnesia_dirty_access_test). -author('[email protected]'). --compile([export_all]). -include("mnesia_test_lib.hrl"). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([dirty_write_ram/1, dirty_write_disc/1, dirty_write_disc_only/1, dirty_write_xets/1, + dirty_read_ram/1, dirty_read_disc/1, dirty_read_disc_only/1, dirty_read_xets/1, + dirty_update_counter_ram/1, dirty_update_counter_disc/1, + dirty_update_counter_disc_only/1, dirty_update_counter_xets/1, + dirty_delete_ram/1, dirty_delete_disc/1, dirty_delete_disc_only/1, dirty_delete_xets/1, + dirty_delete_object_ram/1, dirty_delete_object_disc/1, + dirty_delete_object_disc_only/1, dirty_delete_object_xets/1, + dirty_match_object_ram/1, dirty_match_object_disc/1, + dirty_match_object_disc_only/1, dirty_match_object_xets/1, + dirty_index_match_object_ram/1, dirty_index_match_object_disc/1, + dirty_index_match_object_disc_only/1, dirty_index_match_object_xets/1, + dirty_index_read_ram/1, dirty_index_read_disc/1, + dirty_index_read_disc_only/1, dirty_index_read_xets/1, + dirty_index_update_set_ram/1, dirty_index_update_set_disc/1, + dirty_index_update_set_disc_only/1, dirty_index_update_set_xets/1, + dirty_index_update_bag_ram/1, dirty_index_update_bag_disc/1, + dirty_index_update_bag_disc_only/1, dirty_index_update_bag_xets/1, + dirty_iter_ram/1, dirty_iter_disc/1, dirty_iter_disc_only/1,dirty_iter_xets/1, + del_table_copy_1/1, del_table_copy_2/1, del_table_copy_3/1, + add_table_copy_1/1, add_table_copy_2/1, add_table_copy_3/1, + add_table_copy_4/1, move_table_copy_1/1, move_table_copy_2/1, + move_table_copy_3/1, move_table_copy_4/1]). + +-export([update_trans/3]). + init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index 97bc84a2d8..2fac5cac82 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -21,7 +21,33 @@ %% -module(mnesia_durability_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([durability_of_disc_copies/1, + durability_of_disc_only_copies/1, + load_latest_data/1, load_local_contents_directly/1, + load_directly_when_all_are_ram_copiesA/1, + load_directly_when_all_are_ram_copiesB/1, + load_when_last_replica_becomes_available/1, + load_when_down_from_all_other_replica_nodes/1, + late_load_transforms_into_disc_load/1, + late_load_leads_to_hanging/1, + force_load_when_nobody_intents_to_load/1, + force_load_when_someone_has_decided_to_load/1, + force_load_when_someone_else_has_loaded/1, + force_load_when_we_has_loaded/1, + force_load_on_a_non_local_table/1, + force_load_when_the_table_does_not_exist/1, + late_load_all_ram_cs_ram_nodes1/1, + late_load_all_ram_cs_ram_nodes2/1, + master_nodes/1, starting_master_nodes/1, + master_on_non_local_tables/1, + remote_force_load_with_local_master_node/1, + dump_ram_copies/1, dump_disc_copies/1, dump_disc_only/1]). + -include("mnesia_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl index 0fa72c4305..45b11f2f3f 100644 --- a/lib/mnesia/test/mnesia_evil_backup.erl +++ b/lib/mnesia/test/mnesia_evil_backup.erl @@ -28,10 +28,23 @@ -module(mnesia_evil_backup). -author('[email protected]'). --compile(export_all). -include("mnesia_test_lib.hrl"). -%%-export([Function/Arity, ...]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([backup/1, bad_backup/1, global_backup_checkpoint/1, + traverse_backup/1, + selective_backup_checkpoint/1, + incremental_backup_checkpoint/1, install_fallback/1, + uninstall_fallback/1, local_fallback/1, + sops_with_checkpoint/1, + restore_errors/1, restore_clear/1, restore_keep/1, + restore_recreate/1, restore_clear_ram/1 + ]). + +-export([check_tab/2]). init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 6e34040bc4..074967469b 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -23,7 +23,32 @@ -author('[email protected]'). -include("mnesia_test_lib.hrl"). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([system_info/1, table_info/1, error_description/1, + db_node_lifecycle/1, evil_delete_db_node/1, start_and_stop/1, + checkpoint/1, table_lifecycle/1, storage_options/1, + add_copy_conflict/1, add_copy_when_going_down/1, + replica_management/1, clear_table_during_load/1, + schema_availability/1, local_content/1, + replica_location/1, user_properties/1, unsupp_user_props/1, + sorted_ets/1, + change_table_access_mode/1, change_table_load_order/1, + set_master_nodes/1, offline_set_master_nodes/1, + dump_tables/1, dump_log/1, wait_for_tables/1, force_load_table/1, + snmp_open_table/1, snmp_close_table/1, snmp_get_next_index/1, + snmp_get_row/1, snmp_get_mnesia_key/1, snmp_update_counter/1, + snmp_order/1, subscribe_standard/1, subscribe_extended/1, + foldl/1, info/1, schema_0/1, schema_1/1, view_0/1, view_1/1, view_2/1, + lkill/1, kill/1, + record_name_dirty_access_ram/1, + record_name_dirty_access_disc/1, + record_name_dirty_access_disc_only/1, + record_name_dirty_access_xets/1]). + +-export([info_check/8]). -define(cleanup(N, Config), mnesia_test_lib:prepare_test_case([{reload_appls, [mnesia]}], diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index 808e62d9c2..f1259abf90 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -21,7 +21,14 @@ %% -module(mnesia_examples_test). -author('[email protected]'). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). +-export([bup/1, company/1, meter/1, + replica_test/1, sticky_replica_test/1, dist_test/1, + conflict_test/1, frag_test/1, frag2_test/1, remote_test/1, + remote_frag2_test/1, opt_load/1]). + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl index 9f2102beb2..7371792fda 100644 --- a/lib/mnesia/test/mnesia_frag_test.erl +++ b/lib/mnesia/test/mnesia_frag_test.erl @@ -23,7 +23,17 @@ -author('[email protected]'). -include("mnesia_test_lib.hrl"). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + + +-export([nice_single/1, nice_multi/1, nice_access/1, iter_access/1, + consistency/1, evil_create/1, evil_delete/1, evil_change/1, evil_combine/1, + evil_loop/1, evil_delete_db_node/1]). + + +-export([frag_dist/1]). init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). @@ -845,16 +855,7 @@ frag_rec_dist(Tab) -> Fun = fun() -> mnesia:table_info(Tab, frag_size) end, [Size || {_, Size} <- mnesia:activity(sync_dirty, Fun, mnesia_frag)]. -table_size(Tab) -> - Node = mnesia:table_info(Tab, where_to_read), - rpc:call(Node, mnesia, table_info, [Tab, size]). - sort_res(List) when is_list(List) -> lists:sort(List); sort_res(Else) -> Else. - -rev_res(List) when is_list(List) -> - lists:reverse(List); -rev_res(Else) -> - Else. diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index 103f85b3d6..3f67396eb0 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -21,8 +21,13 @@ %% -module(mnesia_install_test). -author('[email protected]'). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([silly_durability/1, silly_move/1, silly_upgrade/1, conflict/1, dist/1, + silly/0, silly2/1]). --compile([export_all]). -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index 63940ec05c..1c3ea5ec92 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -22,7 +22,36 @@ -module(mnesia_isolation_test). -author('[email protected]'). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([no_conflict/1, simple_queue_conflict/1, + advanced_queue_conflict/1, simple_deadlock_conflict/1, + advanced_deadlock_conflict/1, schema_deadlock/1, lock_burst/1, + nasty/1, basic_sticky_functionality/1, + unbound1/1, unbound2/1, + create_table/1, delete_table/1, move_table_copy/1, + add_table_index/1, del_table_index/1, transform_table/1, + snmp_open_table/1, snmp_close_table/1, + change_table_copy_type/1, change_table_access/1, + add_table_copy/1, del_table_copy/1, dump_tables/1, + del_table_copy_1/1, del_table_copy_2/1, del_table_copy_3/1, + add_table_copy_1/1, add_table_copy_2/1, add_table_copy_3/1, + add_table_copy_4/1, move_table_copy_1/1, move_table_copy_2/1, + move_table_copy_3/1, move_table_copy_4/1, + dirty_updates_visible_direct/1, + dirty_reads_regardless_of_trans/1, + trans_update_invisibible_outside_trans/1, + trans_update_visible_inside_trans/1, write_shadows/1, + delete_shadows/1, write_delete_shadows_bag/1, + write_delete_shadows_bag2/1, + shadow_search/1, snmp_shadows/1, + rr_kill_copy/1, foldl/1, first_next/1]). + +-export([do_fun/4, burst_counter/3, burst_incr/2, get_held/0, get_info/1, + get_sticky/0, op/4, update_own/3, update_shared/3]). + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> @@ -668,16 +697,6 @@ unbound2(Config) when is_list(Config) -> {B, {atomic, [{ul,{key,{17,42}},val}]}}]), ok. -receiver() -> - receive - {_Pid, begin_trans} -> - receiver(); - Else -> - Else - after - 10000 -> - timeout - end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_majority_test.erl b/lib/mnesia/test/mnesia_majority_test.erl index 9811de6ae7..eb82617b60 100644 --- a/lib/mnesia/test/mnesia_majority_test.erl +++ b/lib/mnesia/test/mnesia_majority_test.erl @@ -21,7 +21,13 @@ %% -module(mnesia_majority_test). -author('[email protected]'). --compile(export_all). +-export([init_per_testcase/2, end_per_testcase/2, + all/0]). + +-export([write/1, wread/1, delete/1, clear_table/1, frag/1, + change_majority/1, frag_change_majority/1 + ]). + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index ad71fafecb..4e63eaee22 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -21,7 +21,15 @@ %% -module(mnesia_measure_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([cost/1, dbn_meters/1, + ram_tpcb/1, disc_tpcb/1, disc_only_tpcb/1, + ram_meter/1, disc_meter/1, disc_only_meter/1]). + -include("mnesia_test_lib.hrl"). @@ -39,41 +47,12 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> - [{group, prediction}, {group, consumption}, - {group, scalability}, {group, benchmarks}]. + [{group, benchmarks}]. groups() -> - [{prediction, [], - [reader_disturbed_by_node_down, - writer_disturbed_by_node_down, - reader_disturbed_by_node_up, - writer_disturbed_by_node_up, - reader_disturbed_by_schema_ops, - writer_disturbed_by_schema_ops, - reader_disturbed_by_checkpoint, - writer_disturbed_by_checkpoint, - reader_disturbed_by_dump_log, - writer_disturbed_by_dump_log, - reader_disturbed_by_backup, writer_disturbed_by_backup, - reader_disturbed_by_restore, - writer_disturbed_by_restore, {group, fairness}]}, - {fairness, [], - [reader_competing_with_reader, - reader_competing_with_writer, - writer_competing_with_reader, - writer_competing_with_writer]}, - {consumption, [], - [measure_resource_consumption, - determine_resource_leakage]}, - {scalability, [], - [determine_system_limits, performance_at_min_config, - performance_at_max_config, performance_at_full_load, - resource_consumption_at_min_config, - resource_consumption_at_max_config, - resource_consumption_at_full_load]}, - {benchmarks, [], + [{benchmarks, [], [{group, meter}, cost, dbn_meters, - measure_all_api_functions, {group, tpcb}]}, + {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_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl index ffbe36e48d..7c96d6e6a0 100644 --- a/lib/mnesia/test/mnesia_nice_coverage_test.erl +++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl @@ -21,7 +21,13 @@ %% -module(mnesia_nice_coverage_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([nice/1]). + -include("mnesia_test_lib.hrl"). -record(nice_tab, {key, val}). diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl index 5067e86521..262a6b4abc 100644 --- a/lib/mnesia/test/mnesia_qlc_test.erl +++ b/lib/mnesia/test/mnesia_qlc_test.erl @@ -21,9 +21,18 @@ %% -module(mnesia_qlc_test). --compile(export_all). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([frag/1, info/1, mnesia_down/1, + dirty_nice_ram_copies/1, dirty_nice_disc_copies/1, + dirty_nice_disc_only_copies/1, + trans_nice_ram_copies/1, trans_nice_disc_copies/1, + trans_nice_disc_only_copies/1, atomic_eval/1, + nested_qlc/1 + ]). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). -include("mnesia_test_lib.hrl"). -include_lib("stdlib/include/qlc.hrl"). diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index 130b87346f..82d6e6ac6a 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -21,7 +21,80 @@ %% -module(mnesia_recovery_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([coord_dies/1, after_full_disc_partition/1, + disc_less/1, garb_decision/1, + system_upgrade/1, + delete_during_start/1, + no_master_2/1, no_master_3/1, one_master_2/1, one_master_3/1, + two_master_2/1, two_master_3/1, all_master_2/1, + all_master_3/1, + dirty_read_during_down/1, trans_read_during_down/1, + mnesia_down_during_startup_disk_ram/1, + mnesia_down_during_startup_init_ram/1, + mnesia_down_during_startup_init_disc/1, + mnesia_down_during_startup_init_disc_only/1, + mnesia_down_during_startup_tm_ram/1, + mnesia_down_during_startup_tm_disc/1, + mnesia_down_during_startup_tm_disc_only/1, + with_checkpoint_same/1, with_checkpoint_other/1, + explicit_stop_during_snmp/1, + sym_trans_before_commit_kill_coord_node/1, + sym_trans_before_commit_kill_coord_pid/1, + sym_trans_before_commit_kill_part_after_ask/1, + sym_trans_before_commit_kill_part_before_ask/1, + sym_trans_after_commit_kill_coord_node/1, + sym_trans_after_commit_kill_coord_pid/1, + sym_trans_after_commit_kill_part_after_ask/1, + sym_trans_after_commit_kill_part_do_commit_pre/1, + sym_trans_after_commit_kill_part_do_commit_post/1, + sync_dirty_pre_kill_part/1, + sync_dirty_pre_kill_coord_node/1, + sync_dirty_pre_kill_coord_pid/1, + sync_dirty_post_kill_part/1, + sync_dirty_post_kill_coord_node/1, + sync_dirty_post_kill_coord_pid/1, + async_dirty_pre_kill_part/1, + async_dirty_pre_kill_coord_node/1, + async_dirty_pre_kill_coord_pid/1, + async_dirty_post_kill_part/1, + async_dirty_post_kill_coord_node/1, + async_dirty_post_kill_coord_pid/1, + asymtrans_part_ask/1, + asymtrans_part_commit_vote/1, + asymtrans_part_pre_commit/1, + asymtrans_part_log_commit/1, + asymtrans_part_do_commit/1, + asymtrans_coord_got_votes/1, + asymtrans_coord_pid_got_votes/1, + asymtrans_coord_log_commit_rec/1, + asymtrans_coord_pid_log_commit_rec/1, + asymtrans_coord_log_commit_dec/1, + asymtrans_coord_pid_log_commit_dec/1, + asymtrans_coord_rec_acc_pre_commit_log_commit/1, + asymtrans_coord_pid_rec_acc_pre_commit_log_commit/1, + asymtrans_coord_rec_acc_pre_commit_done_commit/1, + asymtrans_coord_pid_rec_acc_pre_commit_done_commit/1, + after_corrupt_files_decision_log_head/1, + after_corrupt_files_decision_log_tail/1, + after_corrupt_files_latest_log_head/1, + after_corrupt_files_latest_log_tail/1, + after_corrupt_files_table_dat_head/1, + after_corrupt_files_table_dat_tail/1, + after_corrupt_files_schema_dat_head/1, + after_corrupt_files_schema_dat_tail/1]). + +-export([reader/2, check/0, get_all_retainers/1, + verify_data/2, verify_where2read/1, + do_trans_loop/2, + start_stop/3, do_sym_trans/2, do_sync_dirty/2, do_async_dirty/2, + do_asym_trans/2, garb_handler/1, mymnesia_start/1 + ]). + -include("mnesia_test_lib.hrl"). -include_lib("kernel/include/file.hrl"). diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl index 3df37a2c8c..08157f1be3 100644 --- a/lib/mnesia/test/mnesia_registry_test.erl +++ b/lib/mnesia/test/mnesia_registry_test.erl @@ -21,7 +21,12 @@ %% -module(mnesia_registry_test). -author('[email protected]'). --compile([export_all]). +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([good_dump/1, bad_dump/1, dump_registry/2, restore_registry/2]). + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl index ca2dd74b34..5e7627ca47 100644 --- a/lib/mnesia/test/mnesia_schema_recovery_test.erl +++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl @@ -21,7 +21,79 @@ %% -module(mnesia_schema_recovery_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([interrupted_before_create_ram/1, + interrupted_before_create_disc/1, + interrupted_before_create_do/1, + interrupted_before_create_nostore/1, + interrupted_before_delete_ram/1, + interrupted_before_delete_disc/1, + interrupted_before_delete_do/1, + interrupted_before_add_ram/1, + interrupted_before_add_disc/1, + interrupted_before_add_do/1, + interrupted_before_add_kill_copier/1, + interrupted_before_move_ram/1, + interrupted_before_move_disc/1, + interrupted_before_move_do/1, + interrupted_before_move_kill_copier/1, + interrupted_before_delcopy_ram/1, + interrupted_before_delcopy_disc/1, + interrupted_before_delcopy_do/1, + interrupted_before_delcopy_kill_copier/1, + interrupted_before_addindex_ram/1, + interrupted_before_addindex_disc/1, + interrupted_before_addindex_do/1, + interrupted_before_delindex_ram/1, + interrupted_before_delindex_disc/1, + interrupted_before_delindex_do/1, + interrupted_before_change_type_ram2disc/1, + interrupted_before_change_type_ram2do/1, + interrupted_before_change_type_disc2ram/1, + interrupted_before_change_type_disc2do/1, + interrupted_before_change_type_do2ram/1, + interrupted_before_change_type_do2disc/1, + interrupted_before_change_type_other_node/1, + interrupted_before_change_schema_type/1, + interrupted_after_create_ram/1, + interrupted_after_create_disc/1, + interrupted_after_create_do/1, + interrupted_after_create_nostore/1, + interrupted_after_delete_ram/1, + interrupted_after_delete_disc/1, + interrupted_after_delete_do/1, + interrupted_after_add_ram/1, + interrupted_after_add_disc/1, + interrupted_after_add_do/1, + interrupted_after_add_kill_copier/1, + interrupted_after_move_ram/1, + interrupted_after_move_disc/1, + interrupted_after_move_do/1, + interrupted_after_move_kill_copier/1, + interrupted_after_delcopy_ram/1, + interrupted_after_delcopy_disc/1, + interrupted_after_delcopy_do/1, + interrupted_after_delcopy_kill_copier/1, + interrupted_after_addindex_ram/1, + interrupted_after_addindex_disc/1, + interrupted_after_addindex_do/1, + interrupted_after_delindex_ram/1, + interrupted_after_delindex_disc/1, + interrupted_after_delindex_do/1, + interrupted_after_change_type_ram2disc/1, + interrupted_after_change_type_ram2do/1, + interrupted_after_change_type_disc2ram/1, + interrupted_after_change_type_disc2do/1, + interrupted_after_change_type_do2ram/1, + interrupted_after_change_type_do2disc/1, + interrupted_after_change_type_other_node/1, + interrupted_after_change_schema_type/1]). + + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index 4ed73ea859..c00a1ed51f 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -21,7 +21,28 @@ %% -module(mnesia_trans_access_test). -author('[email protected]'). --compile([export_all]). + +-export([init_per_testcase/2, end_per_testcase/2, + init_per_group/2, end_per_group/2, + all/0, groups/0]). + +-export([write/1, read/1, wread/1, delete/1, delete_object/1, + match_object/1, select/1, select14/1, all_keys/1, transaction/1, + basic_nested/1, mix_of_nested_activities/1, + nested_trans_both_ok/1, nested_trans_child_dies/1, + nested_trans_parent_dies/1, nested_trans_both_dies/1, + index_match_object/1, index_read/1,index_write/1, + index_update_set/1, index_update_bag/1, + add_table_index_ram/1, add_table_index_disc/1, + add_table_index_disc_only/1, create_live_table_index_ram/1, + create_live_table_index_disc/1, + create_live_table_index_disc_only/1, del_table_index_ram/1, + del_table_index_disc/1, del_table_index_disc_only/1, + idx_schema_changes_ram/1, idx_schema_changes_disc/1, + idx_schema_changes_disc_only/1]). + +-export([do_nested/1]). + -include("mnesia_test_lib.hrl"). init_per_testcase(Func, Conf) -> diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk index 81b15d65db..a95f468ba2 100644 --- a/lib/mnesia/vsn.mk +++ b/lib/mnesia/vsn.mk @@ -1 +1 @@ -MNESIA_VSN = 4.15 +MNESIA_VSN = 4.15.1 |