From 70373f8cb0a3fe404c1e51e0ade0c98b83aa0014 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 12 Feb 2014 14:50:49 +0100 Subject: mnesia: Add explicit sync_log command For performance reasons the file data is not synced to disk in mnesia, data loss can happen between each dump. mnesia:dump_log() can be used explicitly to ensure data is written to disk. But that can take a long time, so mnesia:sync_log() which just sync the log have been added. --- lib/mnesia/doc/src/mnesia.xml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'lib/mnesia/doc') diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml index 914ec77721..72e9bd7e8f 100644 --- a/lib/mnesia/doc/src/mnesia.xml +++ b/lib/mnesia/doc/src/mnesia.xml @@ -4,7 +4,7 @@
- 19962013 + 19962014 Ericsson AB. All Rights Reserved. @@ -1204,7 +1204,11 @@ mnesia:create_table(person,

Performs a user initiated dump of the local log file. This is usually not necessary since Mnesia, by default, - manages this automatically.

+ manages this automatically. + See configuration parameters + dump_log_time_threshold and + dump_log_write_threshold. +

@@ -2207,6 +2211,18 @@ mnesia:create_table(employee, Mnesia User's Guide for more details.

+ + sync_log() -> ok | {error, Reason} + Perform a file sync of the local log file. + +

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 dump_log/0. +

+
+
+ sync_transaction(Fun, [[, Args], Retries]) -> {aborted, Reason} | {atomic, ResultOfFun} Synchronously execute a transaction. @@ -2445,7 +2461,7 @@ mnesia:create_table(employee, table(Tab [,[Option]]) -> QueryHandle Return a QLC query handle. -

+

Returns a QLC (Query List Comprehension) query handle, see qlc(3).The module qlc 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 true

+

-mnesia dump_log_write_threshold Max, where Max 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) ->

+

-mnesia dump_log_time_threshold Max, where Max is an integer which specifies the dump log interval in milliseconds. It defaults to 3 minutes. If a dump has not been performed within dump_log_time_threshold milliseconds, then a new dump is performed regardless of how many writes have been - performed. + performed.

-- cgit v1.2.3