aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mnesia')
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_A.xml4
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_B.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_C.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_App_D.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap1.xml4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap2.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap3.xml4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap4.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap5.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap7.xmlsrc4
-rw-r--r--lib/mnesia/doc/src/Mnesia_chap8.xml4
-rw-r--r--lib/mnesia/doc/src/book.xml4
-rw-r--r--lib/mnesia/doc/src/fascicules.xml2
-rw-r--r--lib/mnesia/doc/src/mnesia.xml28
-rw-r--r--lib/mnesia/doc/src/mnesia_frag_hash.xml4
-rw-r--r--lib/mnesia/doc/src/mnesia_registry.xml4
-rw-r--r--lib/mnesia/doc/src/notes.xml61
-rw-r--r--lib/mnesia/doc/src/notes_history.xml4
-rw-r--r--lib/mnesia/doc/src/part.xml4
-rw-r--r--lib/mnesia/doc/src/part_notes.xml4
-rw-r--r--lib/mnesia/doc/src/part_notes_history.xml4
-rw-r--r--lib/mnesia/doc/src/ref_man.xml4
-rw-r--r--lib/mnesia/src/mnesia.appup.src14
-rw-r--r--lib/mnesia/src/mnesia.erl10
-rw-r--r--lib/mnesia/src/mnesia_bup.erl6
-rw-r--r--lib/mnesia/src/mnesia_checkpoint.erl279
-rw-r--r--lib/mnesia/src/mnesia_controller.erl18
-rw-r--r--lib/mnesia/src/mnesia_dumper.erl29
-rw-r--r--lib/mnesia/src/mnesia_event.erl4
-rw-r--r--lib/mnesia/src/mnesia_index.erl8
-rw-r--r--lib/mnesia/src/mnesia_lib.erl59
-rw-r--r--lib/mnesia/src/mnesia_locker.erl35
-rw-r--r--lib/mnesia/src/mnesia_log.erl14
-rw-r--r--lib/mnesia/src/mnesia_monitor.erl104
-rw-r--r--lib/mnesia/src/mnesia_recover.erl2
-rw-r--r--lib/mnesia/src/mnesia_subscr.erl4
-rw-r--r--lib/mnesia/src/mnesia_tm.erl11
-rw-r--r--lib/mnesia/test/mnesia_SUITE.erl15
-rw-r--r--lib/mnesia/test/mnesia_consistency_test.erl28
-rw-r--r--lib/mnesia/test/mnesia_dirty_access_test.erl7
-rw-r--r--lib/mnesia/test/mnesia_durability_test.erl30
-rw-r--r--lib/mnesia/test/mnesia_evil_coverage_test.erl25
-rw-r--r--lib/mnesia/test/mnesia_frag_test.erl4
-rw-r--r--lib/mnesia/test/mnesia_nice_coverage_test.erl3
-rw-r--r--lib/mnesia/test/mnesia_schema_recovery_test.erl143
-rw-r--r--lib/mnesia/vsn.mk2
46 files changed, 575 insertions, 446 deletions
diff --git a/lib/mnesia/doc/src/Mnesia_App_A.xml b/lib/mnesia/doc/src/Mnesia_App_A.xml
index 86e5b7d03c..62dbffa14a 100644
--- a/lib/mnesia/doc/src/Mnesia_App_A.xml
+++ b/lib/mnesia/doc/src/Mnesia_App_A.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
index 52f5e06d83..f02e424ca4 100644
--- a/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_B.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
index d8916f25cb..f7fefa36c4 100644
--- a/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_C.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1998</year><year>2009</year>
+ <year>1998</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_App_D.xmlsrc b/lib/mnesia/doc/src/Mnesia_App_D.xmlsrc
index d98680640d..b7a4c270ad 100644
--- a/lib/mnesia/doc/src/Mnesia_App_D.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_App_D.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap1.xml b/lib/mnesia/doc/src/Mnesia_chap1.xml
index 9af81c85cb..540008cdc5 100644
--- a/lib/mnesia/doc/src/Mnesia_chap1.xml
+++ b/lib/mnesia/doc/src/Mnesia_chap1.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
index 473b35b806..f464135a89 100644
--- a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap3.xml b/lib/mnesia/doc/src/Mnesia_chap3.xml
index 5733aedbfd..d6b4a1c6a1 100644
--- a/lib/mnesia/doc/src/Mnesia_chap3.xml
+++ b/lib/mnesia/doc/src/Mnesia_chap3.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
index 7e57c7ac02..a18f853662 100644
--- a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
index 30a8991465..65b950bd46 100644
--- a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2010</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
index ae41a216f4..4458cd3919 100644
--- a/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
+++ b/lib/mnesia/doc/src/Mnesia_chap7.xmlsrc
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/Mnesia_chap8.xml b/lib/mnesia/doc/src/Mnesia_chap8.xml
index 3d2e23cf57..d35dd0c539 100644
--- a/lib/mnesia/doc/src/Mnesia_chap8.xml
+++ b/lib/mnesia/doc/src/Mnesia_chap8.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/book.xml b/lib/mnesia/doc/src/book.xml
index 5389e615c7..d200582a0f 100644
--- a/lib/mnesia/doc/src/book.xml
+++ b/lib/mnesia/doc/src/book.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE book SYSTEM "book.dtd">
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/fascicules.xml b/lib/mnesia/doc/src/fascicules.xml
index 0678195e07..37feca543f 100644
--- a/lib/mnesia/doc/src/fascicules.xml
+++ b/lib/mnesia/doc/src/fascicules.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
<fascicules>
diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml
index 20133cb6cb..72e9bd7e8f 100644
--- a/lib/mnesia/doc/src/mnesia.xml
+++ b/lib/mnesia/doc/src/mnesia.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2011</year>
+ <year>1996</year><year>2014</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -1204,7 +1204,11 @@ mnesia:create_table(person,
<desc>
<p>Performs a user initiated dump of the local log file.
This is usually not necessary since Mnesia, by default,
- manages this automatically.</p>
+ manages this automatically.
+ See configuration parameters
+ <seealso marker="#dump_log_time_threshold">dump_log_time_threshold</seealso> and
+ <seealso marker="#dump_log_write_threshold">dump_log_write_threshold</seealso>.
+ </p>
</desc>
</func>
<func>
@@ -2208,6 +2212,18 @@ mnesia:create_table(employee,
</desc>
</func>
<func>
+ <name>sync_log() -> ok | {error, Reason} </name>
+ <fsummary>Perform a file sync of the local log file.</fsummary>
+ <desc>
+ <p>Ensures that the local transaction log file is synced to disk.
+ On a single node system data written to disk tables, since the last dump,
+ can be lost in case of a power outage.
+ See <seealso marker="#dump_log/0">dump_log/0</seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
<name>sync_transaction(Fun, [[, Args], Retries]) -> {aborted, Reason} | {atomic, ResultOfFun} </name>
<fsummary>Synchronously execute a transaction.</fsummary>
<desc>
@@ -2445,7 +2461,7 @@ mnesia:create_table(employee,
<name>table(Tab [,[Option]]) -> QueryHandle </name>
<fsummary>Return a QLC query handle.</fsummary>
<desc>
- <p> <marker id="qlc_table"></marker>
+ <p><marker id="qlc_table"></marker>
Returns a QLC (Query List Comprehension) query handle, see
<seealso marker="stdlib:qlc">qlc(3)</seealso>.The module <c>qlc</c> implements a query language, it
can use mnesia tables as sources of data. Calling
@@ -3015,6 +3031,7 @@ raise(Name, Amount) ->
performed on the original data file. The default is <c>true</c></p>
</item>
<item>
+ <marker id=" dump_log_write_threshold"></marker>
<p><c>-mnesia dump_log_write_threshold Max</c>, where
<c>Max</c> is an integer which specifies the maximum number of writes
allowed to the transaction log before a new dump of the log
@@ -3022,13 +3039,14 @@ raise(Name, Amount) ->
</p>
</item>
<item>
+ <marker id=" dump_log_time_threshold"></marker>
<p><c>-mnesia dump_log_time_threshold Max</c>,
where <c>Max</c> is an integer which
specifies the dump log interval in milliseconds. It defaults
to 3 minutes. If a dump has not been performed within
<c>dump_log_time_threshold</c> milliseconds, then a new dump is
performed regardless of how many writes have been
- performed.
+ performed.
</p>
</item>
<item>
diff --git a/lib/mnesia/doc/src/mnesia_frag_hash.xml b/lib/mnesia/doc/src/mnesia_frag_hash.xml
index 665796f20d..0d660925e7 100644
--- a/lib/mnesia/doc/src/mnesia_frag_hash.xml
+++ b/lib/mnesia/doc/src/mnesia_frag_hash.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
<year>2002</year>
- <year>2011</year>
+ <year>2013</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/mnesia_registry.xml b/lib/mnesia/doc/src/mnesia_registry.xml
index e08f3a42fc..ad2b927315 100644
--- a/lib/mnesia/doc/src/mnesia_registry.xml
+++ b/lib/mnesia/doc/src/mnesia_registry.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
<year>1998</year>
- <year>2011</year>
+ <year>2013</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml
index 790f5d92b5..0e9131190d 100644
--- a/lib/mnesia/doc/src/notes.xml
+++ b/lib/mnesia/doc/src/notes.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
@@ -38,7 +38,60 @@
thus constitutes one section in this document. The title of each
section is the version number of Mnesia.</p>
- <section><title>Mnesia 4.9</title>
+ <section><title>Mnesia 4.11</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed a race in mnesia which could cause hanging
+ transaction when sticky locks had been used. Thanks
+ janchochol.</p>
+ <p>
+ Own Id: OTP-11375</p>
+ </item>
+ <item>
+ <p>
+ Fixed dirty_update_counter which could return ok, thanks
+ Anton Ryabkov.</p>
+ <p>
+ Own Id: OTP-11485</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Mnesia 4.10</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix timing issues in checkpoint creation.</p>
+ <p>
+ Own Id: OTP-10957</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Fixed a problem where the fallback BUP file is removed
+ when calling mnesia:uninstall_fallback and mnesia is not
+ started.</p>
+ <p>
+ Own Id: OTP-11241</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Mnesia 4.9</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
@@ -115,7 +168,7 @@
<item>
<p>
Remove support for the query keyword and query
- expressions. Thanks to Lo�c Hoguin.</p>
+ expressions. Thanks to Loïc Hoguin.</p>
<p>
Own Id: OTP-10729</p>
</item>
@@ -352,7 +405,7 @@
"-f" is a non-standard chmod option which at least SGI
IRIX and HP UX do not support. As the only effect of the
"-f" flag is to suppress warning messages, it can be
- safely omitted. (Thanks to Holger Wei�)</p>
+ safely omitted. (Thanks to Holger Weiß)</p>
<p>
Own Id: OTP-9170</p>
</item>
diff --git a/lib/mnesia/doc/src/notes_history.xml b/lib/mnesia/doc/src/notes_history.xml
index 0984e33376..28b30f000d 100644
--- a/lib/mnesia/doc/src/notes_history.xml
+++ b/lib/mnesia/doc/src/notes_history.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part.xml b/lib/mnesia/doc/src/part.xml
index b9654a4207..2a16b0a791 100644
--- a/lib/mnesia/doc/src/part.xml
+++ b/lib/mnesia/doc/src/part.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?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>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part_notes.xml b/lib/mnesia/doc/src/part_notes.xml
index caa155585d..cad1b48ed5 100644
--- a/lib/mnesia/doc/src/part_notes.xml
+++ b/lib/mnesia/doc/src/part_notes.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?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>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/part_notes_history.xml b/lib/mnesia/doc/src/part_notes_history.xml
index e4621dbbf7..a97676050f 100644
--- a/lib/mnesia/doc/src/part_notes_history.xml
+++ b/lib/mnesia/doc/src/part_notes_history.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part>
<header>
<copyright>
<year>2004</year>
- <year>2011</year>
+ <year>2013</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/doc/src/ref_man.xml b/lib/mnesia/doc/src/ref_man.xml
index 417423641d..e3c75be6e1 100644
--- a/lib/mnesia/doc/src/ref_man.xml
+++ b/lib/mnesia/doc/src/ref_man.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE application SYSTEM "application.dtd">
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/mnesia/src/mnesia.appup.src b/lib/mnesia/src/mnesia.appup.src
index 355aafb215..c245299740 100644
--- a/lib/mnesia/src/mnesia.appup.src
+++ b/lib/mnesia/src/mnesia.appup.src
@@ -1,22 +1,16 @@
%% -*- erlang -*-
{"%VSN%",
[
- {"4.7.1", [{restart_application, mnesia}]},
- {"4.7", [{restart_application, mnesia}]},
- {"4.6", [{restart_application, mnesia}]},
- {"4.5.1", [{restart_application, mnesia}]},
- {"4.5", [{restart_application, mnesia}]},
+ {<<"4\\.1[0-9].*">>, [{restart_application, mnesia}]},
+ {<<"4\\.[5-9].*">>, [{restart_application, mnesia}]},
{"4.4.19", [{restart_application, mnesia}]},
{"4.4.18", [{restart_application, mnesia}]},
{"4.4.17", [{restart_application, mnesia}]},
{"4.4.16", [{restart_application, mnesia}]}
],
[
- {"4.7.1", [{restart_application, mnesia}]},
- {"4.7", [{restart_application, mnesia}]},
- {"4.6", [{restart_application, mnesia}]},
- {"4.5.1", [{restart_application, mnesia}]},
- {"4.5", [{restart_application, mnesia}]},
+ {<<"4\\.1[0-9].*">>, [{restart_application, mnesia}]},
+ {<<"4\\.[5-9].*">>, [{restart_application, mnesia}]},
{"4.4.19", [{restart_application, mnesia}]},
{"4.4.18", [{restart_application, mnesia}]},
{"4.4.17", [{restart_application, mnesia}]},
diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl
index 70466d10d7..b7d80c1370 100644
--- a/lib/mnesia/src/mnesia.erl
+++ b/lib/mnesia/src/mnesia.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -104,7 +104,8 @@
set_master_nodes/1, set_master_nodes/2,
%% Misc admin
- dump_log/0, subscribe/1, unsubscribe/1, report_event/1,
+ dump_log/0, sync_log/0,
+ subscribe/1, unsubscribe/1, report_event/1,
%% Snmp
snmp_open_table/2, snmp_close_table/1,
@@ -1808,7 +1809,7 @@ do_dirty_rpc(Tab, Node, M, F, Args) ->
{badrpc, Reason} ->
timer:sleep(20), %% Do not be too eager, and can't use yield on SMP
%% Sync with mnesia_monitor
- try sys:get_status(mnesia_monitor) catch _:_ -> ok end,
+ _ = try sys:get_status(mnesia_monitor) catch _:_ -> ok end,
case mnesia_controller:call({check_w2r, Node, Tab}) of % Sync
NewNode when NewNode =:= Node ->
ErrorTag = mnesia_lib:dirty_rpc_error_tag(Reason),
@@ -2554,6 +2555,9 @@ set_master_nodes(Tab, Nodes) ->
dump_log() ->
mnesia_controller:sync_dump_log(user).
+sync_log() ->
+ mnesia_monitor:sync_log(latest_log).
+
subscribe(What) ->
mnesia_subscr:subscribe(self(), What).
diff --git a/lib/mnesia/src/mnesia_bup.erl b/lib/mnesia/src/mnesia_bup.erl
index fd87be1759..3b084e7371 100644
--- a/lib/mnesia/src/mnesia_bup.erl
+++ b/lib/mnesia/src/mnesia_bup.erl
@@ -1052,11 +1052,7 @@ local_uninstall_fallback(Master, FA) ->
Tmp = FA2#fallback_args.fallback_tmp,
Bup = FA2#fallback_args.fallback_bup,
file:delete(Tmp),
- Res =
- case fallback_exists(Bup) of
- true -> file:delete(Bup);
- false -> ok
- end,
+ Res = file:delete(Bup),
?eval_debug_fun({?MODULE, uninstall_fallback2, post_delete}, []),
Master ! {self(), Res},
unlink(Master),
diff --git a/lib/mnesia/src/mnesia_checkpoint.erl b/lib/mnesia/src/mnesia_checkpoint.erl
index eb8fe38908..173e3be2f5 100644
--- a/lib/mnesia/src/mnesia_checkpoint.erl
+++ b/lib/mnesia/src/mnesia_checkpoint.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2013
%%
%% 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
@@ -31,8 +31,7 @@
tm_retain/5,
tm_enter_pending/1,
tm_enter_pending/3,
- tm_exit_pending/1,
- convert_cp_record/1
+ tm_exit_pending/1
]).
%% Public interface
@@ -88,25 +87,6 @@
pid
}).
-%% Old record definition
--record(checkpoint, {name,
- allow_remote,
- ram_overrides_dump,
- nodes,
- node,
- now,
- min,
- max,
- pending_tab,
- wait_for_old,
- is_activated,
- ignore_new,
- retainers,
- iterators,
- supervisor,
- pid
- }).
-
-record(retainer, {cp_name, tab_name, store, writers = [], really_retain = true}).
-record(iter, {tab_name, oid_tab, main_tab, retainer_tab, source, val, pid}).
@@ -129,15 +109,6 @@ tm_prepare(Cp) when is_record(Cp, checkpoint_args) ->
start_retainer(Cp);
true ->
{error, {already_exists, Name, node()}}
- end;
-tm_prepare(Cp) when is_record(Cp, checkpoint) ->
- %% Node with old protocol sent an old checkpoint record
- %% and we have to convert it
- case convert_cp_record(Cp) of
- {ok, NewCp} ->
- tm_prepare(NewCp);
- {error, Reason} ->
- {error, Reason}
end.
tm_mnesia_down(Node) ->
@@ -156,6 +127,7 @@ tm_enter_pending(Pending) ->
tm_enter_pending([], Pending) ->
Pending;
tm_enter_pending([Tab | Tabs], Pending) ->
+ %% io:format("Add ~p ~p ~p~n",[Tab, Pending, hd(tl(element(2, process_info(self(), current_stacktrace))))]),
catch ?ets_insert(Tab, Pending),
tm_enter_pending(Tabs, Pending).
@@ -371,9 +343,7 @@ activate(Args) ->
end.
args2cp(Args) when is_list(Args)->
- case catch lists:foldl(fun check_arg/2, #checkpoint_args{}, Args) of
- {'EXIT', Reason} ->
- {error, Reason};
+ try lists:foldl(fun check_arg/2, #checkpoint_args{}, Args) of
Cp ->
case check_tables(Cp) of
{error, Reason} ->
@@ -381,6 +351,10 @@ args2cp(Args) when is_list(Args)->
{ok, Overriders, AllTabs} ->
arrange_retainers(Cp, Overriders, AllTabs)
end
+ catch exit:Reason ->
+ {error, Reason};
+ error:Reason ->
+ {error, Reason}
end;
args2cp(Args) ->
{error, {badarg, Args}}.
@@ -390,10 +364,10 @@ check_arg({name, Name}, Cp) ->
true ->
exit({already_exists, Name});
false ->
- case catch tab2retainer({foo, Name}) of
- List when is_list(List) ->
- Cp#checkpoint_args{name = Name};
- _ ->
+ try
+ [_|_] = tab2retainer({foo, Name}),
+ Cp#checkpoint_args{name = Name}
+ catch _:_ ->
exit({badarg, Name})
end
end;
@@ -641,11 +615,7 @@ init(Cp) ->
process_flag(priority, high), %% Needed dets files might starve the system
Name = Cp#checkpoint_args.name,
Props = [set, public, {keypos, 2}],
- case catch ?ets_new_table(mnesia_pending_checkpoint, Props) of
- {'EXIT', Reason} -> %% system limit
- Msg = "Cannot create an ets table for pending transactions",
- Error = {error, {system_limit, Name, Msg, Reason}},
- proc_lib:init_ack(Cp#checkpoint_args.supervisor, Error);
+ try ?ets_new_table(mnesia_pending_checkpoint, Props) of
PendingTab ->
Rs = [prepare_tab(Cp, R) || R <- Cp#checkpoint_args.retainers],
Cp2 = Cp#checkpoint_args{retainers = Rs,
@@ -658,6 +628,10 @@ init(Cp) ->
dbg_out("Checkpoint ~p (~p) started~n", [Name, self()]),
proc_lib:init_ack(Cp2#checkpoint_args.supervisor, {ok, self()}),
retainer_loop(Cp2)
+ catch error:Reason -> %% system limit
+ Msg = "Cannot create an ets table for pending transactions",
+ Error = {error, {system_limit, Name, Msg, Reason}},
+ proc_lib:init_ack(Cp#checkpoint_args.supervisor, Error)
end.
prepare_tab(Cp, R) ->
@@ -798,104 +772,142 @@ retainer_delete({dets, Store}) ->
Fname = tab2retainer(Store),
file:delete(Fname).
-retainer_loop(Cp) ->
- Name = Cp#checkpoint_args.name,
+retainer_loop(Cp = #checkpoint_args{is_activated=false, name=Name}) ->
receive
- {_From, {retain, Tid, Tab, Key, OldRecs}}
- when Cp#checkpoint_args.wait_for_old == [] ->
- R = val({Tab, {retainer, Name}}),
- PendingTab = Cp#checkpoint_args.pending_tab,
- case R#retainer.really_retain of
- true when PendingTab =:= undefined ->
- Store = R#retainer.store,
- case retainer_get(Store, Key) of
- [] -> retainer_put(Store, {Tab, Key, OldRecs});
- _ -> already_retained
- end;
- true ->
- case ets:member(PendingTab, Tid) of
- true -> ignore;
- false ->
- Store = R#retainer.store,
- case retainer_get(Store, Key) of
- [] -> retainer_put(Store, {Tab, Key, OldRecs});
- _ -> already_retained
- end
- end;
- false ->
- ignore
- end,
- retainer_loop(Cp);
-
%% Adm
+ {From, {activate, Pending}} ->
+ StillPending = mnesia_recover:still_pending(Pending),
+ enter_still_pending(StillPending, Cp#checkpoint_args.pending_tab),
+ Local = [Tid || #tid{pid=Pid} = Tid <- StillPending, node(Pid) =/= node()],
+ Cp2 = maybe_activate(Cp#checkpoint_args{wait_for_old = Local}),
+
+ reply(From, Name, activated),
+ retainer_loop(Cp2);
+
+ {_From, {exit_pending, Tid}} when is_list(Cp#checkpoint_args.wait_for_old) ->
+ StillPending = lists:delete(Tid, Cp#checkpoint_args.wait_for_old),
+ Cp2 = Cp#checkpoint_args{wait_for_old = StillPending},
+ Cp3 = maybe_activate(Cp2),
+ retainer_loop(Cp3);
+
{From, deactivate} ->
do_stop(Cp),
reply(From, Name, deactivated),
unlink(From),
exit(shutdown);
+ {From, get_checkpoint} ->
+ reply(From, Name, Cp),
+ retainer_loop(Cp);
+ {_From, {add_retainer, R, Node}} ->
+ Cp2 = do_add_retainer(Cp, R, Node),
+ retainer_loop(Cp2);
+
+ {From, collect_pending} ->
+ PendingTab = Cp#checkpoint_args.pending_tab,
+ del(pending_checkpoints, PendingTab),
+ Pending = ?ets_match_object(PendingTab, '_'),
+ reply(From, Name, {ok, Pending}),
+ retainer_loop(Cp);
+
+ {_From, {mnesia_down, Node}} ->
+ Cp2 = do_del_retainers(Cp, Node),
+ retainer_loop(Cp2);
+
{'EXIT', Parent, _} when Parent == Cp#checkpoint_args.supervisor ->
%% do_stop(Cp),
%% assume that entire Mnesia is terminating
exit(shutdown);
- {_From, {mnesia_down, Node}} ->
- Cp2 = do_del_retainers(Cp, Node),
- retainer_loop(Cp2);
+ {'EXIT', From, _Reason} ->
+ Iters = [Iter || Iter <- Cp#checkpoint_args.iterators,
+ check_iter(From, Iter)],
+ retainer_loop(Cp#checkpoint_args{iterators = Iters});
+
+ {system, From, Msg} ->
+ dbg_out("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]),
+ sys:handle_system_msg(Msg, From, Cp#checkpoint_args.supervisor,
+ ?MODULE, [], Cp)
+ end;
+
+retainer_loop(Cp = #checkpoint_args{name=Name}) ->
+ receive
+ {_From, {retain, Tid, Tab, Key, OldRecs}} ->
+ R = val({Tab, {retainer, Name}}),
+ PendingTab = Cp#checkpoint_args.pending_tab,
+ case R#retainer.really_retain of
+ true ->
+ Store = R#retainer.store,
+ try true = ets:member(PendingTab, Tid),
+ %% io:format("CP: ~p ~p ~p ~p~n",[true, Tab, Key, Tid]),
+ case retainer_get(Store, Key) of
+ [] -> ignore;
+ _ -> ets:delete(element(2,Store), Key)
+ end
+ catch _:_ ->
+ %% io:format("CP: ~p ~p ~p ~p~n",[false, Tab, Key, Tid]),
+ case retainer_get(Store, Key) of
+ [] -> retainer_put(Store, {Tab, Key, OldRecs});
+ _ -> already_retained
+ end
+ end;
+ false ->
+ ignore
+ end,
+ retainer_loop(Cp);
+
+ %% Adm
{From, get_checkpoint} ->
reply(From, Name, Cp),
retainer_loop(Cp);
- {From, {add_copy, Tab, Node}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {From, {add_copy, Tab, Node}} ->
{Res, Cp2} = do_add_copy(Cp, Tab, Node),
reply(From, Name, Res),
retainer_loop(Cp2);
- {From, {del_copy, Tab, Node}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {From, {del_copy, Tab, Node}} ->
Cp2 = do_del_copy(Cp, Tab, Node),
reply(From, Name, ok),
retainer_loop(Cp2);
- {From, {change_copy, Tab, From, To}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {From, {change_copy, Tab, From, To}} ->
Cp2 = do_change_copy(Cp, Tab, From, To),
reply(From, Name, ok),
retainer_loop(Cp2);
{_From, {add_retainer, R, Node}} ->
Cp2 = do_add_retainer(Cp, R, Node),
retainer_loop(Cp2);
- {_From, {del_retainer, R, Node}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {_From, {del_retainer, R, Node}} ->
Cp2 = do_del_retainer(Cp, R, Node),
retainer_loop(Cp2);
%% Iteration
- {From, {iter_begin, Iter}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {From, {iter_begin, Iter}} ->
Cp2 = iter_begin(Cp, From, Iter),
retainer_loop(Cp2);
- {From, {iter_end, Iter}} when Cp#checkpoint_args.wait_for_old == [] ->
+ {From, {iter_end, Iter}} ->
retainer_fixtable(Iter#iter.oid_tab, false),
Iters = Cp#checkpoint_args.iterators -- [Iter],
reply(From, Name, ok),
- retainer_loop(Cp#checkpoint_args{iterators = Iters});
-
- {_From, {exit_pending, Tid}}
- when is_list(Cp#checkpoint_args.wait_for_old) ->
- StillPending = lists:delete(Tid, Cp#checkpoint_args.wait_for_old),
- Cp2 = Cp#checkpoint_args{wait_for_old = StillPending},
- Cp3 = maybe_activate(Cp2),
- retainer_loop(Cp3);
+ retainer_loop(Cp#checkpoint_args{iterators = Iters});
- {From, collect_pending} ->
- PendingTab = Cp#checkpoint_args.pending_tab,
- del(pending_checkpoints, PendingTab),
- Pending = ?ets_match_object(PendingTab, '_'),
- reply(From, Name, {ok, Pending}),
+ {_From, {exit_pending, _Tid}} ->
retainer_loop(Cp);
- {From, {activate, Pending}} ->
- StillPending = mnesia_recover:still_pending(Pending),
- enter_still_pending(StillPending, Cp#checkpoint_args.pending_tab),
- Cp2 = maybe_activate(Cp#checkpoint_args{wait_for_old = StillPending}),
- reply(From, Name, activated),
+ {From, deactivate} ->
+ do_stop(Cp),
+ reply(From, Name, deactivated),
+ unlink(From),
+ exit(shutdown);
+
+ {_From, {mnesia_down, Node}} ->
+ Cp2 = do_del_retainers(Cp, Node),
retainer_loop(Cp2);
+ {'EXIT', Parent, _} when Parent == Cp#checkpoint_args.supervisor ->
+ %% do_stop(Cp),
+ %% assume that entire Mnesia is terminating
+ exit(shutdown);
+
{'EXIT', From, _Reason} ->
Iters = [Iter || Iter <- Cp#checkpoint_args.iterators,
check_iter(From, Iter)],
@@ -903,13 +915,17 @@ retainer_loop(Cp) ->
{system, From, Msg} ->
dbg_out("~p got {system, ~p, ~p}~n", [?MODULE, From, Msg]),
- sys:handle_system_msg(Msg, From, no_parent, ?MODULE, [], Cp)
+ sys:handle_system_msg(Msg, From, Cp#checkpoint_args.supervisor,
+ ?MODULE, [], Cp);
+ Msg ->
+ dbg_out("~p got ~p~n", [?MODULE, Msg])
end.
maybe_activate(Cp)
- when Cp#checkpoint_args.wait_for_old == [],
- Cp#checkpoint_args.is_activated == false ->
- Cp#checkpoint_args{pending_tab = undefined, is_activated = true};
+ when Cp#checkpoint_args.wait_for_old == [],
+ Cp#checkpoint_args.is_activated == false ->
+ Cp#checkpoint_args{%% pending_tab = undefined,
+ is_activated = true};
maybe_activate(Cp) ->
Cp.
@@ -1226,65 +1242,6 @@ system_terminate(_Reason, _Parent,_Debug, Cp) ->
system_code_change(Cp, _Module, _OldVsn, _Extra) ->
{ok, Cp}.
-convert_cp_record(Cp) when is_record(Cp, checkpoint) ->
- ROD =
- case Cp#checkpoint.ram_overrides_dump of
- true -> Cp#checkpoint.min ++ Cp#checkpoint.max;
- false -> []
- end,
-
- {ok, #checkpoint_args{name = Cp#checkpoint.name,
- allow_remote = Cp#checkpoint.name,
- ram_overrides_dump = ROD,
- nodes = Cp#checkpoint.nodes,
- node = Cp#checkpoint.node,
- now = Cp#checkpoint.now,
- cookie = ?unique_cookie,
- min = Cp#checkpoint.min,
- max = Cp#checkpoint.max,
- pending_tab = Cp#checkpoint.pending_tab,
- wait_for_old = Cp#checkpoint.wait_for_old,
- is_activated = Cp#checkpoint.is_activated,
- ignore_new = Cp#checkpoint.ignore_new,
- retainers = Cp#checkpoint.retainers,
- iterators = Cp#checkpoint.iterators,
- supervisor = Cp#checkpoint.supervisor,
- pid = Cp#checkpoint.pid
- }};
-convert_cp_record(Cp) when is_record(Cp, checkpoint_args) ->
- AllTabs = Cp#checkpoint_args.min ++ Cp#checkpoint_args.max,
- ROD = case Cp#checkpoint_args.ram_overrides_dump of
- [] ->
- false;
- AllTabs ->
- true;
- _ ->
- error
- end,
- if
- ROD == error ->
- {error, {"Old node cannot handle new checkpoint protocol",
- ram_overrides_dump}};
- true ->
- {ok, #checkpoint{name = Cp#checkpoint_args.name,
- allow_remote = Cp#checkpoint_args.name,
- ram_overrides_dump = ROD,
- nodes = Cp#checkpoint_args.nodes,
- node = Cp#checkpoint_args.node,
- now = Cp#checkpoint_args.now,
- min = Cp#checkpoint_args.min,
- max = Cp#checkpoint_args.max,
- pending_tab = Cp#checkpoint_args.pending_tab,
- wait_for_old = Cp#checkpoint_args.wait_for_old,
- is_activated = Cp#checkpoint_args.is_activated,
- ignore_new = Cp#checkpoint_args.ignore_new,
- retainers = Cp#checkpoint_args.retainers,
- iterators = Cp#checkpoint_args.iterators,
- supervisor = Cp#checkpoint_args.supervisor,
- pid = Cp#checkpoint_args.pid
- }}
- end.
-
%%%%%%%%%%%%%%%%%%%%%%%%%%
val(Var) ->
diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl
index 78f7bfa325..a83e55ac62 100644
--- a/lib/mnesia/src/mnesia_controller.erl
+++ b/lib/mnesia/src/mnesia_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -198,7 +198,8 @@ sync_dump_log(InitBy) ->
call({sync_dump_log, InitBy}).
async_dump_log(InitBy) ->
- ?SERVER_NAME ! {async_dump_log, InitBy}.
+ ?SERVER_NAME ! {async_dump_log, InitBy},
+ ok.
%% Wait for tables to be active
%% If needed, we will wait for Mnesia to start
@@ -293,10 +294,11 @@ update(Fun) ->
mnesia_down(Node) ->
- case cast({mnesia_down, Node}) of
- {error, _} -> mnesia_monitor:mnesia_down(?SERVER_NAME, Node);
- _Pid -> ok
+ case whereis(?SERVER_NAME) of
+ undefined -> mnesia_monitor:mnesia_down(?SERVER_NAME, Node);
+ Pid -> gen_server:cast(Pid, {mnesia_down, Node})
end.
+
wait_for_schema_commit_lock() ->
link(whereis(?SERVER_NAME)),
unsafe_call(wait_for_schema_commit_lock).
@@ -467,7 +469,7 @@ connect_nodes2(Father, Ns, UserFun) ->
process_flag(trap_exit, true),
Res = try_merge_schema(New, [], UserFun),
Msg = {schema_is_merged, [], late_merge, []},
- multicall([node()|Ns], Msg),
+ _ = multicall([node()|Ns], Msg),
After = val({current, db_nodes}),
Father ! {?MODULE, self(), Res, mnesia_lib:intersect(Ns,After)},
unlink(Father),
@@ -548,7 +550,7 @@ schema_is_merged() ->
cast(Msg) ->
case whereis(?SERVER_NAME) of
- undefined ->{error, {node_not_running, node()}};
+ undefined -> ok;
Pid -> gen_server:cast(Pid, Msg)
end.
@@ -1789,7 +1791,7 @@ sync_and_block_table_whereabouts(Tab, ToNode, RemoteS, AccessMode) when Tab /= s
true -> Current -- [ToNode];
false -> Current
end,
- remote_call(ToNode, block_table, [Tab]),
+ _ = remote_call(ToNode, block_table, [Tab]),
[remote_call(Node, add_active_replica, [Tab, ToNode, RemoteS, AccessMode]) ||
Node <- [ToNode | Ns]],
ok.
diff --git a/lib/mnesia/src/mnesia_dumper.erl b/lib/mnesia/src/mnesia_dumper.erl
index e2a0aa3bda..14665797a0 100644
--- a/lib/mnesia/src/mnesia_dumper.erl
+++ b/lib/mnesia/src/mnesia_dumper.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -85,7 +85,7 @@ adjust_log_writes(DoCast) ->
%% Don't care if we lost a few writes
mnesia_lib:set_counter(trans_log_writes_left, Max),
Diff = Max - Left,
- mnesia_lib:incr_counter(trans_log_writes, Diff),
+ _ = mnesia_lib:incr_counter(trans_log_writes, Diff),
global:del_lock(Token, [node()])
end.
@@ -451,7 +451,8 @@ disc_delete_table(Tab, Storage) ->
Storage == disc_only_copies; Tab == schema ->
mnesia_monitor:unsafe_close_dets(Tab),
Dat = mnesia_lib:tab2dat(Tab),
- file:delete(Dat);
+ file:delete(Dat),
+ ok;
true ->
DclFile = mnesia_lib:tab2dcl(Tab),
case get({?MODULE,Tab}) of
@@ -466,13 +467,14 @@ disc_delete_table(Tab, Storage) ->
file:delete(DcdFile),
ok
end,
- erase({?MODULE, Tab});
+ erase({?MODULE, Tab}),
+ ok;
false ->
- ignore
+ ok
end.
disc_delete_indecies(_Tab, _Cs, Storage) when Storage /= disc_only_copies ->
- ignore;
+ ok;
disc_delete_indecies(Tab, Cs, disc_only_copies) ->
Indecies = Cs#cstruct.index,
mnesia_index:del_transient(Tab, Indecies, disc_only_copies).
@@ -522,10 +524,11 @@ insert_op(Tid, _, {op, change_table_copy_type, N, FromS, ToS, TabDef}, InPlace,
{disc_copies, ram_copies} when Tab == schema ->
mnesia_lib:set(use_dir, false),
mnesia_monitor:unsafe_close_dets(Tab),
- file:delete(Dat);
+ ok = file:delete(Dat);
{disc_copies, ram_copies} ->
- file:delete(Dcl),
- file:delete(Dcd);
+ _ = file:delete(Dcl),
+ _ = file:delete(Dcd),
+ ok;
{ram_copies, disc_only_copies} ->
ok = ensure_rename(Dmp, Dat),
true = open_files(Tab, disc_only_copies, InPlace, InitBy),
@@ -544,7 +547,8 @@ insert_op(Tid, _, {op, change_table_copy_type, N, FromS, ToS, TabDef}, InPlace,
startup ->
ignore;
_ ->
- mnesia_controller:get_disc_copy(Tab)
+ mnesia_controller:get_disc_copy(Tab),
+ ok
end,
disc_delete_table(Tab, disc_only_copies);
{disc_copies, disc_only_copies} ->
@@ -553,8 +557,9 @@ insert_op(Tid, _, {op, change_table_copy_type, N, FromS, ToS, TabDef}, InPlace,
mnesia_schema:ram_delete_table(Tab, FromS),
PosList = Cs#cstruct.index,
mnesia_index:init_indecies(Tab, disc_only_copies, PosList),
- file:delete(Dcl),
- file:delete(Dcd);
+ _ = file:delete(Dcl),
+ _ = file:delete(Dcd),
+ ok;
{disc_only_copies, disc_copies} ->
mnesia_monitor:unsafe_close_dets(Tab),
disc_delete_indecies(Tab, Cs, disc_only_copies),
diff --git a/lib/mnesia/src/mnesia_event.erl b/lib/mnesia/src/mnesia_event.erl
index 35fe2d4035..67ec9d7399 100644
--- a/lib/mnesia/src/mnesia_event.erl
+++ b/lib/mnesia/src/mnesia_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -63,7 +63,7 @@ handle_event(Event, State) ->
%%-----------------------------------------------------------------
handle_info(Msg, State) ->
- handle_any_event(Msg, State),
+ {ok, _} = handle_any_event(Msg, State),
{ok, State}.
%%-----------------------------------------------------------------
diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl
index 54db45e3ba..8fef611a48 100644
--- a/lib/mnesia/src/mnesia_index.erl
+++ b/lib/mnesia/src/mnesia_index.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -229,7 +229,7 @@ del_transient(Tab, Storage) ->
PosList = val({Tab, index}),
del_transient(Tab, PosList, Storage).
-del_transient(_, [], _) -> done;
+del_transient(_, [], _) -> ok;
del_transient(Tab, [Pos | Tail], Storage) ->
delete_transient_index(Tab, Pos, Storage),
del_transient(Tab, Tail, Storage).
@@ -237,7 +237,7 @@ del_transient(Tab, [Pos | Tail], Storage) ->
delete_transient_index(Tab, Pos, disc_only_copies) ->
Tag = {Tab, index, Pos},
mnesia_monitor:unsafe_close_dets(Tag),
- file:delete(tab2filename(Tab, Pos)),
+ _ = file:delete(tab2filename(Tab, Pos)),
del_index_info(Tab, Pos), %% Uses val(..)
mnesia_lib:unset({Tab, {index, Pos}});
@@ -255,7 +255,7 @@ init_disc_index(_Tab, []) ->
init_disc_index(Tab, [Pos | Tail]) when is_integer(Pos) ->
Fn = tab2filename(Tab, Pos),
IxTag = {Tab, index, Pos},
- file:delete(Fn),
+ _ = file:delete(Fn),
Args = [{file, Fn}, {keypos, 1}, {type, bag}],
mnesia_monitor:open_dets(IxTag, Args),
Storage = disc_only_copies,
diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl
index ae6631646c..109e924971 100644
--- a/lib/mnesia/src/mnesia_lib.erl
+++ b/lib/mnesia/src/mnesia_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -296,11 +296,7 @@ active_here(Tab) ->
not_active_here(Tab) ->
not active_here(Tab).
-exists(Fname) ->
- case file:open(Fname, [raw,read]) of
- {ok, F} ->file:close(F), true;
- _ -> false
- end.
+exists(Fname) -> filelib:is_regular(Fname).
dir() -> mnesia_monitor:get_env(dir).
@@ -596,7 +592,7 @@ coredump(CrashInfo) ->
Core = mkcore(CrashInfo),
Out = core_file(),
important("Writing Mnesia core to file: ~p...~p~n", [Out, CrashInfo]),
- file:write_file(Out, Core),
+ _ = file:write_file(Out, Core),
Out.
core_file() ->
@@ -620,7 +616,7 @@ mkcore(CrashInfo) ->
Core = [
CrashInfo,
{time, {date(), time()}},
- {self, catch process_info(self())},
+ {self, proc_dbg_info(self())},
{nodes, catch rpc:multicall(Nodes, ?MODULE, get_node_number, [])},
{applications, catch lists:sort(application:loaded_applications())},
{flags, catch init:get_arguments()},
@@ -697,7 +693,7 @@ relatives() ->
Info = fun(Name) ->
case whereis(Name) of
undefined -> false;
- Pid -> {true, {Name, Pid, catch process_info(Pid)}}
+ Pid -> {true, {Name, Pid, proc_dbg_info(Pid)}}
end
end,
lists:zf(Info, mnesia:ms()).
@@ -706,14 +702,14 @@ workers({workers, Loaders, Senders, Dumper}) ->
Info = fun({Pid, {send_table, Tab, _Receiver, _St}}) ->
case Pid of
undefined -> false;
- Pid -> {true, {Pid, Tab, catch process_info(Pid)}}
+ Pid -> {true, {Pid, Tab, proc_dbg_info(Pid)}}
end;
({Pid, What}) when is_pid(Pid) ->
- {true, {Pid, What, catch process_info(Pid)}};
+ {true, {Pid, What, proc_dbg_info(Pid)}};
({Name, Pid}) ->
case Pid of
undefined -> false;
- Pid -> {true, {Name, Pid, catch process_info(Pid)}}
+ Pid -> {true, {Name, Pid, proc_dbg_info(Pid)}}
end
end,
SInfo = lists:zf(Info, Senders),
@@ -727,13 +723,21 @@ locking_procs(LockList) when is_list(LockList) ->
Pid = Tid#tid.pid,
case node(Pid) == node() of
true ->
- {true, {Pid, catch process_info(Pid)}};
+ {true, {Pid, proc_dbg_info(Pid)}};
_ ->
false
end
end,
lists:zf(Info, UT).
+proc_dbg_info(Pid) ->
+ try
+ [process_info(Pid, current_stacktrace)|
+ process_info(Pid)]
+ catch _:R ->
+ [{process_info,crashed,R}]
+ end.
+
view() ->
Bin = mkcore({crashinfo, {"view only~n", []}}),
vcore(Bin).
@@ -806,9 +810,9 @@ vcore(File) ->
vcore_elem({schema_file, {ok, B}}) ->
Fname = "/tmp/schema.DAT",
- file:write_file(Fname, B),
- dets:view(Fname),
- file:delete(Fname);
+ _ = file:write_file(Fname, B),
+ _ = dets:view(Fname),
+ _ = file:delete(Fname);
vcore_elem({logfile, {ok, BinList}}) ->
Fun = fun({F, Info}) ->
@@ -922,7 +926,7 @@ random_time(Retries, _Counter0) ->
case get(random_seed) of
undefined ->
{X, Y, Z} = erlang:now(), %% time()
- random:seed(X, Y, Z),
+ _ = random:seed(X, Y, Z),
Time = Dup + random:uniform(MaxIntv),
%% dbg_out("---random_test rs ~w max ~w val ~w---~n", [Retries, MaxIntv, Time]),
Time;
@@ -958,20 +962,17 @@ report_system_event({'EXIT', Reason}, Event) ->
unlink(Pid),
%% We get an exit signal if server dies
- receive
- {'EXIT', Pid, _Reason} ->
- {error, {node_not_running, node()}}
- after 0 ->
- gen_event:stop(mnesia_event),
- ok
+ receive {'EXIT', Pid, _Reason} -> ok
+ after 0 -> gen_event:stop(mnesia_event)
end;
Error ->
Msg = "Mnesia(~p): Cannot report event ~p: ~p (~p)~n",
error_logger:format(Msg, [node(), Event, Reason, Error])
- end;
+ end,
+ ok;
report_system_event(_Res, _Event) ->
- ignore.
+ ok.
%% important messages are reported regardless of debug level
important(Format, Args) ->
@@ -1025,8 +1026,8 @@ copy_file(From, To) ->
case file:open(To, [raw, binary, write]) of
{ok, T} ->
Res = copy_file_loop(F, T, 8000),
- file:close(F),
- file:close(T),
+ ok = file:close(F),
+ ok = file:close(T),
Res;
{error, Reason} ->
{error, Reason}
@@ -1038,7 +1039,7 @@ copy_file(From, To) ->
copy_file_loop(F, T, ChunkSize) ->
case file:read(F, ChunkSize) of
{ok, Bin} ->
- file:write(T, Bin),
+ ok = file:write(T, Bin),
copy_file_loop(F, T, ChunkSize);
eof ->
ok;
@@ -1205,7 +1206,7 @@ dets_to_ets(Tabname, Tab, File, Type, Rep, Lock) ->
{keypos, 2}, {repair, Rep}]) of
{ok, Tabname} ->
Res = dets:to_ets(Tabname, Tab),
- Close(Tabname),
+ ok = Close(Tabname),
trav_ret(Res, Tab);
Other ->
Other
diff --git a/lib/mnesia/src/mnesia_locker.erl b/lib/mnesia/src/mnesia_locker.erl
index 14011003d3..32cea903c9 100644
--- a/lib/mnesia/src/mnesia_locker.erl
+++ b/lib/mnesia/src/mnesia_locker.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -26,8 +26,8 @@
global_lock/5,
ixrlock/5,
init/1,
- mnesia_down/2,
release_tid/1,
+ mnesia_down/2,
async_release_tid/2,
send_release_tid/2,
receive_release_tid_acc/2,
@@ -103,7 +103,8 @@ val(Var) ->
end.
reply(From, R) ->
- From ! {?MODULE, node(), R}.
+ From ! {?MODULE, node(), R},
+ true. %% Quiets dialyzer
l_request(Node, X, Store) ->
{?MODULE, Node} ! {self(), X},
@@ -137,6 +138,17 @@ receive_release_tid_acc([Node | Nodes], Tid) ->
receive_release_tid_acc([], _Tid) ->
ok.
+mnesia_down(Node, Pending) ->
+ case whereis(?MODULE) of
+ undefined -> {error, node_not_running};
+ Pid ->
+ Ref = make_ref(),
+ Pid ! {{self(), Ref}, {release_remote_non_pending, Node, Pending}},
+ receive %% No need to wait for anything else if process dies we die soon
+ {Ref,ok} -> ok
+ end
+ end.
+
loop(State) ->
receive
{From, {write, Tid, Oid}} ->
@@ -213,9 +225,9 @@ loop(State) ->
reply(From, {tid_released, Tid}),
loop(State);
- {release_remote_non_pending, Node, Pending} ->
+ {{From, Ref},{release_remote_non_pending, Node, Pending}} ->
release_remote_non_pending(Node, Pending),
- mnesia_monitor:mnesia_down(?MODULE, Node),
+ From ! {Ref, ok},
loop(State);
{'EXIT', Pid, _} when Pid == State#state.supervisor ->
@@ -653,19 +665,6 @@ ix_read_res(Tab,IxKey,Pos) ->
%% ********************* end server code ********************
%% The following code executes at the client side of a transactions
-mnesia_down(N, Pending) ->
- case whereis(?MODULE) of
- undefined ->
- %% Takes care of mnesia_down's in early startup
- mnesia_monitor:mnesia_down(?MODULE, N);
- Pid ->
- %% Syncronously call needed in order to avoid
- %% race with mnesia_tm's coordinator processes
- %% that may restart and acquire new locks.
- %% mnesia_monitor ensures the sync.
- Pid ! {release_remote_non_pending, N, Pending}
- end.
-
%% Aquire a write lock, but do a read, used by
%% mnesia:wread/1
diff --git a/lib/mnesia/src/mnesia_log.erl b/lib/mnesia/src/mnesia_log.erl
index 18303869ed..d2fd04a60b 100644
--- a/lib/mnesia/src/mnesia_log.erl
+++ b/lib/mnesia/src/mnesia_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -393,13 +393,15 @@ unsafe_close_log(Log) ->
purge_some_logs() ->
mnesia_monitor:unsafe_close_log(latest_log),
- file:delete(latest_log_file()),
- file:delete(decision_tab_file()).
+ _ = file:delete(latest_log_file()),
+ _ = file:delete(decision_tab_file()),
+ ok.
purge_all_logs() ->
- file:delete(previous_log_file()),
- file:delete(latest_log_file()),
- file:delete(decision_tab_file()).
+ _ = file:delete(previous_log_file()),
+ _ = file:delete(latest_log_file()),
+ _ = file:delete(decision_tab_file()),
+ ok.
%% Prepare dump by renaming the open logfile if possible
%% Returns a tuple on the following format: {Res, OpenLog}
diff --git a/lib/mnesia/src/mnesia_monitor.erl b/lib/mnesia/src/mnesia_monitor.erl
index 7a788238fc..6fc1a394a6 100644
--- a/lib/mnesia/src/mnesia_monitor.erl
+++ b/lib/mnesia/src/mnesia_monitor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -44,6 +44,7 @@
set_env/2,
start/0,
start_proc/4,
+ sync_log/1,
terminate_proc/3,
unsafe_close_dets/1,
unsafe_close_log/1,
@@ -78,7 +79,7 @@
-record(state, {supervisor, pending_negotiators = [],
going_down = [], tm_started = false, early_connects = [],
- connecting, mq = []}).
+ connecting, mq = [], remote_node_status = []}).
-define(current_protocol_version, {8,1}).
@@ -118,6 +119,9 @@ open_log(Args) ->
reopen_log(Name, Fname, Head) ->
unsafe_call({reopen_log, Name, Fname, Head}).
+sync_log(Name) ->
+ unsafe_call({sync_log, Name}).
+
close_log(Name) ->
unsafe_call({close_log, Name}).
@@ -202,7 +206,7 @@ needs_protocol_conversion(Node) ->
cast(Msg) ->
case whereis(?MODULE) of
- undefined -> ignore;
+ undefined -> ok;
Pid -> gen_server:cast(Pid, Msg)
end.
@@ -382,6 +386,9 @@ handle_call({reopen_log, Name, Fname, Head}, _From, State) ->
{noreply, State}
end;
+handle_call({sync_log, Name}, _From, State) ->
+ {reply, disk_log:sync(Name), State};
+
handle_call({close_log, Name}, _From, State) ->
case disk_log:close(Name) of
ok ->
@@ -395,7 +402,7 @@ handle_call({close_log, Name}, _From, State) ->
end;
handle_call({unsafe_close_log, Name}, _From, State) ->
- disk_log:close(Name),
+ _ = disk_log:close(Name),
{reply, ok, State};
handle_call({negotiate_protocol, Mon, _Version, _Protocols}, _From, State)
@@ -439,7 +446,7 @@ handle_call({negotiate_protocol, Nodes}, From, State) ->
end;
handle_call(init, _From, State) ->
- net_kernel:monitor_nodes(true),
+ _ = net_kernel:monitor_nodes(true),
EarlyNodes = State#state.early_connects,
State2 = State#state{tm_started = true},
{reply, EarlyNodes, State2};
@@ -482,27 +489,24 @@ handle_cast({mnesia_down, mnesia_controller, Node}, State) ->
mnesia_tm:mnesia_down(Node),
{noreply, State};
-handle_cast({mnesia_down, mnesia_tm, {Node, Pending}}, State) ->
- mnesia_locker:mnesia_down(Node, Pending),
- {noreply, State};
-
-handle_cast({mnesia_down, mnesia_locker, Node}, State) ->
+handle_cast({mnesia_down, mnesia_tm, Node}, State) ->
Down = {mnesia_down, Node},
mnesia_lib:report_system_event(Down),
GoingDown = lists:delete(Node, State#state.going_down),
State2 = State#state{going_down = GoingDown},
Pending = State#state.pending_negotiators,
+ State3 = check_raise_conditon_nodeup(Node, State2),
case lists:keysearch(Node, 1, Pending) of
{value, {Node, Mon, ReplyTo, Reply}} ->
%% Late reply to remote monitor
link(Mon), %% link to remote Monitor
gen_server:reply(ReplyTo, Reply),
P2 = lists:keydelete(Node, 1,Pending),
- State3 = State2#state{pending_negotiators = P2},
- process_q(State3);
+ State4 = State3#state{pending_negotiators = P2},
+ process_q(State4);
false ->
%% No pending remote monitors
- process_q(State2)
+ process_q(State3)
end;
handle_cast({disconnect, Node}, State) ->
@@ -568,27 +572,18 @@ handle_info({protocol_negotiated, From,Res}, State) ->
gen_server:reply(From, Res),
process_q(State#state{connecting = undefined});
-handle_info({nodeup, Node}, State) ->
- %% Ok, we are connected to yet another Erlang node
- %% Let's check if Mnesia is running there in order
- %% to detect if the network has been partitioned
- %% due to communication failure.
-
- HasDown = mnesia_recover:has_mnesia_down(Node),
- ImRunning = mnesia_lib:is_running(),
+handle_info({check_nodeup, Node}, State) ->
+ State2 = check_mnesia_down(Node, State),
+ {noreply, State2};
- if
- %% If I'm not running the test will be made later.
- HasDown == true, ImRunning == yes ->
- spawn_link(?MODULE, detect_partitioned_network, [self(), Node]);
- true ->
- ignore
- end,
- {noreply, State};
+handle_info({nodeup, Node}, State) ->
+ State2 = remote_node_status(Node, up, State),
+ State3 = check_mnesia_down(Node, State2),
+ {noreply, State3};
-handle_info({nodedown, _Node}, State) ->
- %% Ignore, we are only caring about nodeup's
- {noreply, State};
+handle_info({nodedown, Node}, State) ->
+ State2 = remote_node_status(Node, down, State),
+ {noreply, State2};
handle_info({disk_log, _Node, Log, Info}, State) ->
case Info of
@@ -830,3 +825,48 @@ report_inconsistency([{badrpc, _Reason} | Replies], Context, Status) ->
report_inconsistency(Replies, Context, Status);
report_inconsistency([], _Context, Status) ->
Status.
+
+remote_node_status(Node, Status, State) ->
+ {ok, Nodes} = mnesia_schema:read_nodes(),
+ case lists:member(Node, Nodes) of
+ true ->
+ update_node_status({Node, Status}, State);
+ _ ->
+ State
+ end.
+
+update_node_status({Node, down}, State = #state{remote_node_status = RNodeS}) ->
+ RNodeS2 = lists:ukeymerge(1, [{Node, down}], RNodeS),
+ State#state{remote_node_status = RNodeS2};
+update_node_status({Node, up}, State = #state{remote_node_status = RNodeS}) ->
+ case lists:keyfind(Node, 1, RNodeS) of
+ {Node, down} ->
+ RNodeS2 = lists:ukeymerge(1, [{Node, up}], RNodeS),
+ State#state{remote_node_status = RNodeS2};
+ _ ->
+ State
+ end.
+
+check_raise_conditon_nodeup(Node, State = #state{remote_node_status = RNodeS}) ->
+ case lists:keyfind(Node, 1, RNodeS) of
+ {Node, up} ->
+ self() ! {check_nodeup, Node};
+ _ ->
+ ignore
+ end,
+ State#state{remote_node_status = lists:keydelete(Node, 1, RNodeS)}.
+
+check_mnesia_down(Node, State = #state{remote_node_status = RNodeS}) ->
+ %% Check if the network has been partitioned
+ %% due to communication failure.
+
+ HasDown = mnesia_recover:has_mnesia_down(Node),
+ ImRunning = mnesia_lib:is_running(),
+ if
+ %% If I'm not running the test will be made later.
+ HasDown == true, ImRunning == yes ->
+ spawn_link(?MODULE, detect_partitioned_network, [self(), Node]),
+ State#state{remote_node_status = lists:keydelete(Node, 1, RNodeS)};
+ true ->
+ State
+ end.
diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl
index 7aa03bda37..0548a25ebf 100644
--- a/lib/mnesia/src/mnesia_recover.erl
+++ b/lib/mnesia/src/mnesia_recover.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
diff --git a/lib/mnesia/src/mnesia_subscr.erl b/lib/mnesia/src/mnesia_subscr.erl
index 8f78dc55e8..9272211ad2 100644
--- a/lib/mnesia/src/mnesia_subscr.erl
+++ b/lib/mnesia/src/mnesia_subscr.erl
@@ -204,7 +204,9 @@ what(Tab, Tid, Obj, write, undefined) ->
{mnesia_table_event, {write, Tab, Obj, Old, Tid}};
{'EXIT', _} ->
ignore
- end.
+ end;
+what(Tab, Tid, Obj, write, Old) ->
+ {mnesia_table_event, {write, Tab, Obj, Old, Tid}}.
deliver(_, ignore) ->
ok;
diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl
index e54e5c4e88..af658150da 100644
--- a/lib/mnesia/src/mnesia_tm.erl
+++ b/lib/mnesia/src/mnesia_tm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -181,9 +181,10 @@ mnesia_down(Node) ->
%% mnesia_monitor takes care of the sync
case whereis(?MODULE) of
undefined ->
- mnesia_monitor:mnesia_down(?MODULE, {Node, []});
+ mnesia_monitor:mnesia_down(?MODULE, Node);
Pid ->
- Pid ! {mnesia_down, Node}
+ Pid ! {mnesia_down, Node},
+ ok
end.
prepare_checkpoint(Nodes, Cp) ->
@@ -403,7 +404,9 @@ doit_loop(#state{coordinators=Coordinators,participants=Participants,supervisor=
Tids = gb_trees:keys(Participants),
reconfigure_participants(N, gb_trees:values(Participants)),
NewState = clear_fixtable(N, State),
- mnesia_monitor:mnesia_down(?MODULE, {N, Tids}),
+
+ mnesia_locker:mnesia_down(N, Tids),
+ mnesia_monitor:mnesia_down(?MODULE, N),
doit_loop(NewState);
{From, {unblock_me, Tab}} ->
diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl
index e0004ecb51..921ebb71e9 100644
--- a/lib/mnesia/test/mnesia_SUITE.erl
+++ b/lib/mnesia/test/mnesia_SUITE.erl
@@ -21,6 +21,7 @@
-module(mnesia_SUITE).
-author('[email protected]').
-compile([export_all]).
+-include_lib("common_test/include/ct.hrl").
-include("mnesia_test_lib.hrl").
init_per_testcase(Func, Conf) ->
@@ -50,7 +51,7 @@ suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]}].
%% and do not involve the normal test machinery.
all() ->
- [{group, light}, {group, medium}, {group, heavy},
+ [app, appup, {group, light}, {group, medium}, {group, heavy},
clean_up_suite].
groups() ->
@@ -144,6 +145,18 @@ silly() ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test structure of the mnesia application resource file
+app(Config) when is_list(Config) ->
+ ok = ?t:app_test(mnesia).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Test that all required versions have appup directives
+appup(Config) when is_list(Config) ->
+ ok = ?t:appup_test(mnesia).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
clean_up_suite(doc) -> ["Not a test case only kills mnesia and nodes, that where"
"started during the tests"];
clean_up_suite(suite) ->
diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl
index 922b89ec2b..a76a0116d5 100644
--- a/lib/mnesia/test/mnesia_consistency_test.erl
+++ b/lib/mnesia/test/mnesia_consistency_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. 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
@@ -39,7 +39,6 @@ all() ->
{group, consistency_after_move_replica},
{group, consistency_after_transform_table},
consistency_after_change_table_copy_type,
- {group, consistency_after_fallback},
{group, consistency_after_restore},
consistency_after_rename_of_node,
{group, checkpoint_retainer_consistency},
@@ -99,10 +98,14 @@ groups() ->
[{group, updates_during_checkpoint_activation},
{group, updates_during_checkpoint_iteration},
{group, load_table_with_activated_checkpoint},
- {group,
- add_table_copy_to_table_checkpoint}]},
+ {group, add_table_copy_to_table_checkpoint},
+ {group, consistency_after_fallback}
+ ]},
{updates_during_checkpoint_activation, [],
- [updates_during_checkpoint_activation_2_ram,
+ [updates_during_checkpoint_activation_1_ram,
+ updates_during_checkpoint_activation_1_disc,
+ updates_during_checkpoint_activation_1_disc_only,
+ updates_during_checkpoint_activation_2_ram,
updates_during_checkpoint_activation_2_disc,
updates_during_checkpoint_activation_2_disc_only,
updates_during_checkpoint_activation_3_ram,
@@ -730,6 +733,18 @@ consistency_after_rename_of_node(doc) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+updates_during_checkpoint_activation_1_ram(suite) -> [];
+updates_during_checkpoint_activation_1_ram(Config) when is_list(Config) ->
+ updates_during_checkpoint_activation(ram_copies, 1, Config).
+
+updates_during_checkpoint_activation_1_disc(suite) -> [];
+updates_during_checkpoint_activation_1_disc(Config) when is_list(Config) ->
+ updates_during_checkpoint_activation(disc_copies, 1, Config).
+
+updates_during_checkpoint_activation_1_disc_only(suite) -> [];
+updates_during_checkpoint_activation_1_disc_only(Config) when is_list(Config) ->
+ updates_during_checkpoint_activation(disc_only_copies, 1, Config).
+
updates_during_checkpoint_activation_2_ram(suite) -> [];
updates_during_checkpoint_activation_2_ram(Config) when is_list(Config) ->
updates_during_checkpoint_activation(ram_copies, 2, Config).
@@ -771,7 +786,8 @@ updates_during_checkpoint_activation(ReplicaType,NodeConfig,Config) ->
timer:sleep(timer:seconds(Delay)),
{ok, CPName, _NodeList} =
- mnesia:activate_checkpoint([{max, mnesia:system_info(tables)}]),
+ mnesia:activate_checkpoint([{max, mnesia:system_info(tables)},
+ {ram_overrides_dump, true}]),
timer:sleep(timer:seconds(Delay)),
%% Stop tpcb
diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl
index 6017092095..519b4bb052 100644
--- a/lib/mnesia/test/mnesia_dirty_access_test.erl
+++ b/lib/mnesia/test/mnesia_dirty_access_test.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
@@ -198,6 +198,11 @@ dirty_update_counter(Config, Storage) ->
?match(1, mnesia:dirty_update_counter({Tab, foo}, 1)),
?match([{Tab, foo,1}], mnesia:dirty_read({Tab,foo})),
+ ?match({ok,_}, mnesia:subscribe({table, Tab, detailed})),
+
+ ?match(2, mnesia:dirty_update_counter({Tab, foo}, 1)),
+ ?match([{Tab, foo,2}], mnesia:dirty_read({Tab,foo})),
+
?verify_mnesia(Nodes, []).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl
index 4434abaa1e..366fda7044 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-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -48,19 +48,19 @@ groups() ->
load_directly_when_all_are_ram_copiesB,
{group, late_load_when_all_are_ram_copies_on_ram_nodes},
load_when_last_replica_becomes_available,
- load_when_we_have_down_from_all_other_replica_nodes,
+ load_when_down_from_all_other_replica_nodes,
late_load_transforms_into_disc_load,
late_load_leads_to_hanging,
force_load_when_nobody_intents_to_load,
force_load_when_someone_has_decided_to_load,
- force_load_when_someone_else_already_has_loaded,
+ force_load_when_someone_else_has_loaded,
force_load_when_we_has_loaded,
force_load_on_a_non_local_table,
force_load_when_the_table_does_not_exist,
{group, load_tables_with_master_tables}]},
{late_load_when_all_are_ram_copies_on_ram_nodes, [],
- [late_load_when_all_are_ram_copies_on_ram_nodes1,
- late_load_when_all_are_ram_copies_on_ram_nodes2]},
+ [late_load_all_ram_cs_ram_nodes1,
+ late_load_all_ram_cs_ram_nodes2]},
{load_tables_with_master_tables, [],
[master_nodes, starting_master_nodes,
master_on_non_local_tables,
@@ -292,8 +292,8 @@ load_directly_when_all_are_ram_copiesB(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-late_load_when_all_are_ram_copies_on_ram_nodes1(suite) -> [];
-late_load_when_all_are_ram_copies_on_ram_nodes1(Config) when is_list(Config) ->
+late_load_all_ram_cs_ram_nodes1(suite) -> [];
+late_load_all_ram_cs_ram_nodes1(Config) when is_list(Config) ->
[N1, N2] = mnesia_test_lib:prepare_test_case([{init_test_case, [mnesia]},
delete_schema,
{reload_appls, [mnesia]}],
@@ -303,8 +303,8 @@ late_load_when_all_are_ram_copies_on_ram_nodes1(Config) when is_list(Config) ->
2, Config, ?FILE, ?LINE),
Res.
-late_load_when_all_are_ram_copies_on_ram_nodes2(suite) -> [];
-late_load_when_all_are_ram_copies_on_ram_nodes2(Config) when is_list(Config) ->
+late_load_all_ram_cs_ram_nodes2(suite) -> [];
+late_load_all_ram_cs_ram_nodes2(Config) when is_list(Config) ->
[N1, N2, N3] = mnesia_test_lib:prepare_test_case([{init_test_case, [mnesia]},
delete_schema,
{reload_appls, [mnesia]}],
@@ -439,13 +439,13 @@ load_when_last_replica_becomes_available(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-load_when_we_have_down_from_all_other_replica_nodes(doc) ->
+load_when_down_from_all_other_replica_nodes(doc) ->
["The table can be loaded if this node was the last one surviving. ",
"Check this by having N1, N2, N3 and a table replicated on all those ",
"nodes. Then kill them in the N1, N2, N3 order. Then start N3 and ",
"verify that the table is available with correct contents."];
-load_when_we_have_down_from_all_other_replica_nodes(suite) -> [];
-load_when_we_have_down_from_all_other_replica_nodes(Config) when is_list(Config) ->
+load_when_down_from_all_other_replica_nodes(suite) -> [];
+load_when_down_from_all_other_replica_nodes(Config) when is_list(Config) ->
[N1, N2, N3] = Nodes = ?acquire_nodes(3, Config),
?match({atomic,ok},
mnesia:create_table(test_rec,
@@ -773,14 +773,14 @@ wait_for_signal() ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-force_load_when_someone_else_already_has_loaded(doc) ->
+force_load_when_someone_else_has_loaded(doc) ->
["Normal case. Do a force load when somebody else has loaded the table. ",
"Start N1, N2, kill in N1, N2 order. Start N2 load the table, start N1 ",
"force load. Did it work? (i.e: did N1 load the table from N2 as that",
"one is the latest version and it is available on N2)"];
-force_load_when_someone_else_already_has_loaded(suite) -> [];
-force_load_when_someone_else_already_has_loaded(Config) when is_list(Config) ->
+force_load_when_someone_else_has_loaded(suite) -> [];
+force_load_when_someone_else_has_loaded(Config) when is_list(Config) ->
[N1, N2] = Nodes = ?acquire_nodes(2, Config),
Table = test_rec,
Trec1 = #test_rec{key=1,val=111},
diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl
index db23a39943..91820238e5 100644
--- a/lib/mnesia/test/mnesia_evil_coverage_test.erl
+++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl
@@ -1869,14 +1869,19 @@ subscribe_extended(Config) when is_list(Config) ->
{attributes, record_info(fields, tab)}],
?match({atomic, ok}, mnesia:create_table(Tab2, Def2)),
+ Tab3 = ctab,
+ Def3 = [{Storage, [N1, N2]}],
+ ?match({atomic, ok}, mnesia:create_table(Tab3, Def3)),
+
?match({ok, N1}, mnesia:subscribe({table, Tab1, detailed})),
?match({ok, N1}, mnesia:subscribe({table, Tab2, detailed})),
+ ?match({ok, N1}, mnesia:subscribe({table, Tab3, detailed})),
?match({error, {already_exists, _}}, mnesia:subscribe({table, Tab1, simple})),
?match({error, {badarg, {table, Tab1, bad}}}, mnesia:subscribe({table, Tab1, bad})),
?match({ok, N1}, mnesia:subscribe(activity)),
- test_ext_sub(Tab1, Tab2),
+ test_ext_sub(Tab1, Tab2, Tab3),
?match({ok, N1}, mnesia:unsubscribe(activity)),
?match({ok, N1}, mnesia:subscribe({table, Tab1, detailed})),
@@ -1895,11 +1900,11 @@ subscribe_extended(Config) when is_list(Config) ->
{max, [Tab1, Tab2]}]),
?match({ok, N1}, mnesia:subscribe({table, Tab2, detailed})),
?match({ok, N1}, mnesia:subscribe(activity)),
- test_ext_sub(Tab1, Tab2),
+ test_ext_sub(Tab1, Tab2, Tab3),
?verify_mnesia(Nodes, []).
-test_ext_sub(Tab1, Tab2) ->
+test_ext_sub(Tab1, Tab2, Tab3) ->
%% The basics
Rec1 = {Tab1, 1, 0, 0},
Rec2 = {Tab1, 1, 1, 0},
@@ -1940,7 +1945,6 @@ test_ext_sub(Tab1, Tab2) ->
?match({atomic, ok}, Delete(Tab1, 1)),
?match({mnesia_table_event, {delete, Tab1, {Tab1, 1}, [], {tid,_,S}}}, recv_event()),
?match({mnesia_activity_event, {complete, {tid,_,S}}}, recv_event()),
-
?match({ok, _N1}, mnesia:unsubscribe({table, Tab1, detailed})),
%% BAG
@@ -1969,6 +1973,17 @@ test_ext_sub(Tab1, Tab2) ->
?match({atomic, ok}, Delete(Tab2, 2)),
?match({mnesia_table_event, {delete, Tab2, {Tab2, 2}, [Rec4, Rec3], {tid,_,S}}}, recv_event()),
?match({mnesia_activity_event, {complete, {tid,_,S}}}, recv_event()),
+
+ %% COUNTERS
+
+ Rec5 = {Tab3, counter, 0},
+ ?match(ok, mnesia:dirty_write(Rec5)),
+ ?match({mnesia_table_event, {write, Tab3, Rec5, [], D}}, recv_event()),
+ ?match(1, mnesia:dirty_update_counter({Tab3, counter}, 1)),
+ ?match({mnesia_table_event, {write, Tab3, {Tab3,counter,1}, [Rec5], D}}, recv_event()),
+ ?match(ok, mnesia:dirty_delete({Tab3, counter})),
+ ?match({mnesia_table_event, {delete, Tab3, {Tab3,counter},
+ [{Tab3,counter,1}], D}}, recv_event()),
ok.
@@ -1987,7 +2002,7 @@ subscribe_standard(Config) when is_list(Config)->
%% Check system events
?match({error, {badarg, foo}}, mnesia:unsubscribe(foo)),
?match({error, badarg}, mnesia:unsubscribe({table, foo})),
- ?match(_, mnesia:unsubscribe(activity)),
+ mnesia:unsubscribe(activity),
?match({ok, N1}, mnesia:subscribe(system)),
?match({ok, N1}, mnesia:subscribe(activity)),
diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl
index d3f6762af7..6695fbc880 100644
--- a/lib/mnesia/test/mnesia_frag_test.erl
+++ b/lib/mnesia/test/mnesia_frag_test.erl
@@ -461,7 +461,7 @@ nice_iter_access(Tab, FragNames, RawRead) ->
ExpectedLast = lists:last(Keys),
?match(ExpectedLast, mnesia:last(Tab)),
- ExpectedAllPrev = ['$end_of_table' | lists:reverse(tl(lists:reverse(Keys)))],
+ ExpectedAllPrev = ['$end_of_table' | lists:droplast(Keys)],
?match(ExpectedAllPrev, lists:map(fun(K) -> mnesia:prev(Tab, K) end, Keys)),
ExpectedAllNext = tl(Keys) ++ ['$end_of_table'],
@@ -477,7 +477,7 @@ evil_iter_access(Tab, FragNames, RawRead) ->
ExpectedLast = lists:last(Keys),
?match(ExpectedLast, mnesia:last(Tab)),
- ExpectedAllPrev = ['$end_of_table' | lists:reverse(tl(lists:reverse(Keys)))],
+ ExpectedAllPrev = ['$end_of_table' | lists:droplast(Keys)],
?match(ExpectedAllPrev, lists:map(fun(K) -> mnesia:prev(Tab, K) end, Keys)),
ExpectedAllNext = tl(Keys) ++ ['$end_of_table'],
diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl
index 78eab67b11..4b28ac634f 100644
--- a/lib/mnesia/test/mnesia_nice_coverage_test.erl
+++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -189,6 +189,7 @@ adm(Attrs, Node1, Node2) ->
?match({atomic, ok}, mnesia:move_table_copy(nice_tab, Node2, Node1)),
?match(yes, mnesia:force_load_table(nice_counter_tab)),
+ ?match(ok, mnesia:sync_log()),
?match(dumped, mnesia:dump_log()),
ok.
diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl
index 0fe26efd0b..2301b291c2 100644
--- a/lib/mnesia/test/mnesia_schema_recovery_test.erl
+++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -49,66 +49,69 @@ groups() ->
[{interrupted_before_log_dump, [],
[interrupted_before_create_ram,
interrupted_before_create_disc,
- interrupted_before_create_disc_only,
+ interrupted_before_create_do,
interrupted_before_create_nostore,
interrupted_before_delete_ram,
interrupted_before_delete_disc,
- interrupted_before_delete_disc_only,
- interrupted_before_add_ram, interrupted_before_add_disc,
- interrupted_before_add_disc_only,
+ interrupted_before_delete_do,
+ interrupted_before_add_ram,
+ interrupted_before_add_disc,
+ interrupted_before_add_do,
interrupted_before_add_kill_copier,
interrupted_before_move_ram,
interrupted_before_move_disc,
- interrupted_before_move_disc_only,
+ interrupted_before_move_do,
interrupted_before_move_kill_copier,
interrupted_before_delcopy_ram,
interrupted_before_delcopy_disc,
- interrupted_before_delcopy_disc_only,
+ interrupted_before_delcopy_do,
interrupted_before_delcopy_kill_copier,
interrupted_before_addindex_ram,
interrupted_before_addindex_disc,
- interrupted_before_addindex_disc_only,
+ interrupted_before_addindex_do,
interrupted_before_delindex_ram,
interrupted_before_delindex_disc,
- interrupted_before_delindex_disc_only,
+ interrupted_before_delindex_do,
interrupted_before_change_type_ram2disc,
- interrupted_before_change_type_ram2disc_only,
+ interrupted_before_change_type_ram2do,
interrupted_before_change_type_disc2ram,
- interrupted_before_change_type_disc2disc_only,
- interrupted_before_change_type_disc_only2ram,
- interrupted_before_change_type_disc_only2disc,
+ interrupted_before_change_type_disc2do,
+ interrupted_before_change_type_do2ram,
+ interrupted_before_change_type_do2disc,
interrupted_before_change_type_other_node,
interrupted_before_change_schema_type]},
{interrupted_after_log_dump, [],
[interrupted_after_create_ram,
interrupted_after_create_disc,
- interrupted_after_create_disc_only,
+ interrupted_after_create_do,
interrupted_after_create_nostore,
interrupted_after_delete_ram,
interrupted_after_delete_disc,
- interrupted_after_delete_disc_only,
- interrupted_after_add_ram, interrupted_after_add_disc,
- interrupted_after_add_disc_only,
+ interrupted_after_delete_do,
+ interrupted_after_add_ram,
+ interrupted_after_add_disc,
+ interrupted_after_add_do,
interrupted_after_add_kill_copier,
- interrupted_after_move_ram, interrupted_after_move_disc,
- interrupted_after_move_disc_only,
+ interrupted_after_move_ram,
+ interrupted_after_move_disc,
+ interrupted_after_move_do,
interrupted_after_move_kill_copier,
interrupted_after_delcopy_ram,
interrupted_after_delcopy_disc,
- interrupted_after_delcopy_disc_only,
+ interrupted_after_delcopy_do,
interrupted_after_delcopy_kill_copier,
interrupted_after_addindex_ram,
interrupted_after_addindex_disc,
- interrupted_after_addindex_disc_only,
+ interrupted_after_addindex_do,
interrupted_after_delindex_ram,
interrupted_after_delindex_disc,
- interrupted_after_delindex_disc_only,
+ interrupted_after_delindex_do,
interrupted_after_change_type_ram2disc,
- interrupted_after_change_type_ram2disc_only,
+ interrupted_after_change_type_ram2do,
interrupted_after_change_type_disc2ram,
- interrupted_after_change_type_disc2disc_only,
- interrupted_after_change_type_disc_only2ram,
- interrupted_after_change_type_disc_only2disc,
+ interrupted_after_change_type_disc2do,
+ interrupted_after_change_type_do2ram,
+ interrupted_after_change_type_do2disc,
interrupted_after_change_type_other_node,
interrupted_after_change_schema_type]}].
@@ -128,8 +131,8 @@ interrupted_before_create_disc(Config) when is_list(Config) ->
KillAt = {mnesia_dumper, dump_schema_op},
interrupted_create(Config, disc_copies, all, KillAt).
-interrupted_before_create_disc_only(suite) -> [];
-interrupted_before_create_disc_only(Config) when is_list(Config) ->
+interrupted_before_create_do(suite) -> [];
+interrupted_before_create_do(Config) when is_list(Config) ->
KillAt = {mnesia_dumper, dump_schema_op},
interrupted_create(Config, disc_only_copies, all, KillAt).
@@ -148,8 +151,8 @@ interrupted_after_create_disc(Config) when is_list(Config) ->
KillAt = {mnesia_dumper, post_dump},
interrupted_create(Config, disc_copies, all, KillAt).
-interrupted_after_create_disc_only(suite) -> [];
-interrupted_after_create_disc_only(Config) when is_list(Config) ->
+interrupted_after_create_do(suite) -> [];
+interrupted_after_create_do(Config) when is_list(Config) ->
KillAt = {mnesia_dumper, post_dump},
interrupted_create(Config, disc_only_copies, all, KillAt).
@@ -204,8 +207,8 @@ interrupted_before_delete_disc(suite) -> [];
interrupted_before_delete_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delete(Config, disc_copies, Debug_Point).
-interrupted_before_delete_disc_only(suite) -> [];
-interrupted_before_delete_disc_only(Config) when is_list(Config) ->
+interrupted_before_delete_do(suite) -> [];
+interrupted_before_delete_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delete(Config, disc_only_copies, Debug_Point).
@@ -217,8 +220,8 @@ interrupted_after_delete_disc(suite) -> [];
interrupted_after_delete_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delete(Config, disc_copies, Debug_Point).
-interrupted_after_delete_disc_only(suite) -> [];
-interrupted_after_delete_disc_only(Config) when is_list(Config) ->
+interrupted_after_delete_do(suite) -> [];
+interrupted_after_delete_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delete(Config, disc_only_copies, Debug_Point).
@@ -249,8 +252,8 @@ interrupted_before_add_disc(suite) -> [];
interrupted_before_add_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_add(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_before_add_disc_only(suite) -> [];
-interrupted_before_add_disc_only(Config) when is_list(Config) ->
+interrupted_before_add_do(suite) -> [];
+interrupted_before_add_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_add(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_before_add_kill_copier(suite) -> [];
@@ -266,8 +269,8 @@ interrupted_after_add_disc(suite) -> [];
interrupted_after_add_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_add(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_after_add_disc_only(suite) -> [];
-interrupted_after_add_disc_only(Config) when is_list(Config) ->
+interrupted_after_add_do(suite) -> [];
+interrupted_after_add_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_add(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_after_add_kill_copier(suite) -> [];
@@ -327,8 +330,8 @@ interrupted_before_move_disc(suite) -> [];
interrupted_before_move_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_move(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_before_move_disc_only(suite) -> [];
-interrupted_before_move_disc_only(Config) when is_list(Config) ->
+interrupted_before_move_do(suite) -> [];
+interrupted_before_move_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_move(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_before_move_kill_copier(suite) -> [];
@@ -344,8 +347,8 @@ interrupted_after_move_disc(suite) -> [];
interrupted_after_move_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_move(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_after_move_disc_only(suite) -> [];
-interrupted_after_move_disc_only(Config) when is_list(Config) ->
+interrupted_after_move_do(suite) -> [];
+interrupted_after_move_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_move(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_after_move_kill_copier(suite) -> [];
@@ -408,8 +411,8 @@ interrupted_before_delcopy_disc(suite) -> [];
interrupted_before_delcopy_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delcopy(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_before_delcopy_disc_only(suite) -> [];
-interrupted_before_delcopy_disc_only(Config) when is_list(Config) ->
+interrupted_before_delcopy_do(suite) -> [];
+interrupted_before_delcopy_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delcopy(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_before_delcopy_kill_copier(suite) -> [];
@@ -425,8 +428,8 @@ interrupted_after_delcopy_disc(suite) -> [];
interrupted_after_delcopy_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delcopy(Config, disc_copies, kill_reciever, Debug_Point).
-interrupted_after_delcopy_disc_only(suite) -> [];
-interrupted_after_delcopy_disc_only(Config) when is_list(Config) ->
+interrupted_after_delcopy_do(suite) -> [];
+interrupted_after_delcopy_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delcopy(Config, disc_only_copies, kill_reciever, Debug_Point).
interrupted_after_delcopy_kill_copier(suite) -> [];
@@ -487,8 +490,8 @@ interrupted_before_addindex_disc(suite) -> [];
interrupted_before_addindex_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_addindex(Config, disc_copies, Debug_Point).
-interrupted_before_addindex_disc_only(suite) -> [];
-interrupted_before_addindex_disc_only(Config) when is_list(Config) ->
+interrupted_before_addindex_do(suite) -> [];
+interrupted_before_addindex_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_addindex(Config, disc_only_copies, Debug_Point).
@@ -500,8 +503,8 @@ interrupted_after_addindex_disc(suite) -> [];
interrupted_after_addindex_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_addindex(Config, disc_copies, Debug_Point).
-interrupted_after_addindex_disc_only(suite) -> [];
-interrupted_after_addindex_disc_only(Config) when is_list(Config) ->
+interrupted_after_addindex_do(suite) -> [];
+interrupted_after_addindex_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_addindex(Config, disc_only_copies, Debug_Point).
@@ -555,8 +558,8 @@ interrupted_before_delindex_disc(suite) -> [];
interrupted_before_delindex_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delindex(Config, disc_copies, Debug_Point).
-interrupted_before_delindex_disc_only(suite) -> [];
-interrupted_before_delindex_disc_only(Config) when is_list(Config) ->
+interrupted_before_delindex_do(suite) -> [];
+interrupted_before_delindex_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_delindex(Config, disc_only_copies, Debug_Point).
@@ -568,8 +571,8 @@ interrupted_after_delindex_disc(suite) -> [];
interrupted_after_delindex_disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delindex(Config, disc_copies, Debug_Point).
-interrupted_after_delindex_disc_only(suite) -> [];
-interrupted_after_delindex_disc_only(Config) when is_list(Config) ->
+interrupted_after_delindex_do(suite) -> [];
+interrupted_after_delindex_do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_delindex(Config, disc_only_copies, Debug_Point).
@@ -613,24 +616,24 @@ interrupted_before_change_type_ram2disc(suite) -> [];
interrupted_before_change_type_ram2disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, ram_copies, disc_copies, changer, Debug_Point).
-interrupted_before_change_type_ram2disc_only(suite) -> [];
-interrupted_before_change_type_ram2disc_only(Config) when is_list(Config) ->
+interrupted_before_change_type_ram2do(suite) -> [];
+interrupted_before_change_type_ram2do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, ram_copies, disc_only_copies, changer, Debug_Point).
interrupted_before_change_type_disc2ram(suite) -> [];
interrupted_before_change_type_disc2ram(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, disc_copies, ram_copies, changer, Debug_Point).
-interrupted_before_change_type_disc2disc_only(suite) -> [];
-interrupted_before_change_type_disc2disc_only(Config) when is_list(Config) ->
+interrupted_before_change_type_disc2do(suite) -> [];
+interrupted_before_change_type_disc2do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, disc_copies, disc_only_copies, changer, Debug_Point).
-interrupted_before_change_type_disc_only2ram(suite) -> [];
-interrupted_before_change_type_disc_only2ram(Config) when is_list(Config) ->
+interrupted_before_change_type_do2ram(suite) -> [];
+interrupted_before_change_type_do2ram(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, disc_only_copies, ram_copies, changer, Debug_Point).
-interrupted_before_change_type_disc_only2disc(suite) -> [];
-interrupted_before_change_type_disc_only2disc(Config) when is_list(Config) ->
+interrupted_before_change_type_do2disc(suite) -> [];
+interrupted_before_change_type_do2disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, dump_schema_op},
interrupted_change_type(Config, disc_only_copies, disc_copies, changer, Debug_Point).
interrupted_before_change_type_other_node(suite) -> [];
@@ -642,24 +645,24 @@ interrupted_after_change_type_ram2disc(suite) -> [];
interrupted_after_change_type_ram2disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, ram_copies, disc_copies, changer, Debug_Point).
-interrupted_after_change_type_ram2disc_only(suite) -> [];
-interrupted_after_change_type_ram2disc_only(Config) when is_list(Config) ->
+interrupted_after_change_type_ram2do(suite) -> [];
+interrupted_after_change_type_ram2do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, ram_copies, disc_only_copies, changer, Debug_Point).
interrupted_after_change_type_disc2ram(suite) -> [];
interrupted_after_change_type_disc2ram(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, disc_copies, ram_copies, changer, Debug_Point).
-interrupted_after_change_type_disc2disc_only(suite) -> [];
-interrupted_after_change_type_disc2disc_only(Config) when is_list(Config) ->
+interrupted_after_change_type_disc2do(suite) -> [];
+interrupted_after_change_type_disc2do(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, disc_copies, disc_only_copies, changer, Debug_Point).
-interrupted_after_change_type_disc_only2ram(suite) -> [];
-interrupted_after_change_type_disc_only2ram(Config) when is_list(Config) ->
+interrupted_after_change_type_do2ram(suite) -> [];
+interrupted_after_change_type_do2ram(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, disc_only_copies, ram_copies, changer, Debug_Point).
-interrupted_after_change_type_disc_only2disc(suite) -> [];
-interrupted_after_change_type_disc_only2disc(Config) when is_list(Config) ->
+interrupted_after_change_type_do2disc(suite) -> [];
+interrupted_after_change_type_do2disc(Config) when is_list(Config) ->
Debug_Point = {mnesia_dumper, post_dump},
interrupted_change_type(Config, disc_only_copies, disc_copies, changer, Debug_Point).
interrupted_after_change_type_other_node(suite) -> [];
diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk
index d7a132bc1a..064ba43791 100644
--- a/lib/mnesia/vsn.mk
+++ b/lib/mnesia/vsn.mk
@@ -1 +1 @@
-MNESIA_VSN = 4.9
+MNESIA_VSN = 4.11