head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.53.29; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.10; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.48.59; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.12.06.00.08.06; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.04.58; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @ Berkeley DB: DbEnv::memp_sync

DbEnv::memp_sync

APIRef

#include <db_cxx.h>

int DbEnv::memp_sync(DbLsn *lsn);

Description

The DbEnv::memp_sync method ensures that any modified pages in the pool with log sequence numbers less than the lsn argument are written to disk. If lsn is NULL, all modified pages in the pool are flushed.

The primary purpose of the DbEnv::memp_sync function is to enable a transaction manager to ensure, as part of a checkpoint, that all pages modified by a certain time have been written to disk. Pages in the pool that cannot be written back to disk immediately (for example, pages that are currently pinned) are written to disk as soon as it is possible to do so. The expected behavior of the Berkeley DB or other Transaction subsystem is to call the DbEnv::memp_sync function and then, if the return indicates that some pages could not be written immediately, to wait briefly and retry again with the same log sequence number until the DbEnv::memp_sync function returns that all pages have been written.

To support the DbEnv::memp_sync functionality, it is necessary that the pool functions know the location of the log sequence number on the page for each file type. This location should be specified when the file is opened using the DbMpoolFile::open function. It is not required that the log sequence number be aligned on the page in any way.

The DbEnv::memp_sync method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, 0 on success, and returns DB_INCOMPLETE if there were pages which need to be written but that DbEnv::memp_sync was unable to write immediately. In addition, if DbEnv::memp_sync returns success, the value of lsn will be overwritten with the largest log sequence number from any page that was written by DbEnv::memp_sync to satisfy this request.

Errors

The DbEnv::memp_sync method may fail and throw an exception or return a non-zero error for the following conditions:

EINVAL
An invalid flag value or parameter was specified.

The DbEnv::memp_sync function was called without logging having been initialized in the environment.

The DbEnv::memp_sync method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv::memp_sync method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.

Class

DbEnv, DbMpoolFile

See Also

DbEnv::set_cachesize, DbEnv::set_mp_mmapsize, DbMpoolFile::close, DbMpoolFile::get, DbMpoolFile::open, DbMpoolFile::put, DbMpoolFile::set, DbMpoolFile::sync, DbEnv::memp_register, DbEnv::memp_stat, DbEnv::memp_sync, and DbEnv::memp_trickle.

APIRef

Copyright Sleepycat Software @ 1.1 log @Initial revision @ text @d1 1 a1 1 @ 1.1.1.1 log @Import: RPM 4.0.3 @ text @@ 1.1.1.2 log @Import: RPM 4.0.4 @ text @d1 1 a1 1 d17 1 a17 1 APIRef d29 3 a31 3 a log sequence number (DbLsn) less than the lsn argument are written to disk. If lsn is NULL, all modified pages in the pool are flushed. d46 1 a46 1 opened using the DbMpoolFile::set_lsn_offset method. It is not required that a71 1 DbEnv::memp_fcreate, a78 5 DbMpoolFile::set_clear_len, DbMpoolFile::set_fileid, DbMpoolFile::set_ftype, DbMpoolFile::set_lsn_offset, DbMpoolFile::set_pgcookie, d85 1 a85 1 APIRef @ 1.1.1.3 log @Import: RPM 4.0.5 @ text @d1 2 a2 2 a3 1 d30 13 a42 8 are written to disk. The purpose of the lsn argument is to enable a transaction manager to ensure, as part of a checkpoint, that all pages modified by a certain time have been written to disk. Pages in the pool that cannot be immediately written back to disk (for example, pages that are currently in use by another thread of control) are waited for and written to disk as soon as it is possible to do so. If lsn is NULL, all modified pages in the pool are written to disk. d49 6 a54 1 encapsulates a non-zero error value on failure, and returns 0 on success. d63 4 a66 4 If a catastrophic error has occurred, the DbEnv::memp_sync method may fail and either return DB_RUNRECOVERY or throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way. d68 1 a68 1 DbEnv, DbMpoolFile d70 19 a88 1 Memory Pools and Related Methods @ 1.1.1.4 log @Import: RPM 4.1 @ text @d1 2 a2 2 d4 1 d31 8 a38 13 are written to disk. If lsn is NULL, all modified pages in the pool are flushed.

The primary purpose of the DbEnv::memp_sync function is to enable a transaction manager to ensure, as part of a checkpoint, that all pages modified by a certain time have been written to disk. Pages in the pool that cannot be written back to disk immediately (for example, pages that are currently pinned) are written to disk as soon as it is possible to do so. The expected behavior of the Berkeley DB or other Transaction subsystem is to call the DbEnv::memp_sync function and then, if the return indicates that some pages could not be written immediately, to wait briefly and retry again with the same log sequence number until the DbEnv::memp_sync function returns that all pages have been written. d45 1 a45 6 encapsulates a non-zero error value on failure, 0 on success, and returns DB_INCOMPLETE if there were pages which need to be written but that DbEnv::memp_sync was unable to write immediately. In addition, if DbEnv::memp_sync returns success, the value of lsn will be overwritten with the largest log sequence number from any page that was written by DbEnv::memp_sync to satisfy this request. d54 4 a57 4 If a catastrophic error has occurred, the DbEnv::memp_sync method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way. d59 1 a59 1 DbEnv, DbMpoolFile d61 1 a61 19 DbEnv::set_cachesize, DbEnv::set_mp_mmapsize, DbEnv::memp_fcreate, DbMpoolFile::close, DbMpoolFile::get, DbMpoolFile::open, DbMpoolFile::put, DbMpoolFile::set, DbMpoolFile::sync, DbEnv::memp_register, DbMpoolFile::set_clear_len, DbMpoolFile::set_fileid, DbMpoolFile::set_ftype, DbMpoolFile::set_lsn_offset, DbMpoolFile::set_pgcookie, DbEnv::memp_stat, DbEnv::memp_sync, and DbEnv::memp_trickle. @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d1 2 a2 2 a3 1 d30 13 a42 8 are written to disk. The purpose of the lsn argument is to enable a transaction manager to ensure, as part of a checkpoint, that all pages modified by a certain time have been written to disk. Pages in the pool that cannot be immediately written back to disk (for example, pages that are currently in use by another thread of control) are waited for and written to disk as soon as it is possible to do so. If lsn is NULL, all modified pages in the pool are written to disk. d49 6 a54 1 encapsulates a non-zero error value on failure, and returns 0 on success. d63 4 a66 4 If a catastrophic error has occurred, the DbEnv::memp_sync method may fail and either return DB_RUNRECOVERY or throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way. d68 1 a68 1 DbEnv, DbMpoolFile d70 19 a88 1 Memory Pools and Related Methods @