mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 17:19:43 -05:00
Add MDB_NOMETASYNC env option.
Just a trial. This may not make sense if we decide to split the meta pages into their own separate file, to allow meta traffic to reside on a separate spindle.
This commit is contained in:
parent
38560c2517
commit
df7ddb6bf4
2 changed files with 12 additions and 4 deletions
|
|
@ -3037,7 +3037,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode)
|
|||
}
|
||||
|
||||
if ((rc = mdb_env_open2(env, flags)) == MDB_SUCCESS) {
|
||||
if (flags & (MDB_RDONLY|MDB_NOSYNC)) {
|
||||
if (flags & (MDB_RDONLY|MDB_NOSYNC|MDB_NOMETASYNC)) {
|
||||
env->me_mfd = env->me_fd;
|
||||
} else {
|
||||
/* synchronous fd for meta writes */
|
||||
|
|
@ -6096,7 +6096,7 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi,
|
|||
* at runtime. Changing other flags requires closing the environment
|
||||
* and re-opening it with the new flags.
|
||||
*/
|
||||
#define CHANGEABLE (MDB_NOSYNC)
|
||||
#define CHANGEABLE (MDB_NOSYNC|MDB_NOMETASYNC)
|
||||
int
|
||||
mdb_env_set_flags(MDB_env *env, unsigned int flag, int onoff)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -159,6 +159,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel
|
|||
#define MDB_NOSYNC 0x10000
|
||||
/** read only */
|
||||
#define MDB_RDONLY 0x20000
|
||||
/** don't fsync metapage after commit */
|
||||
#define MDB_NOMETASYNC 0x40000
|
||||
/** @} */
|
||||
|
||||
/** @defgroup mdb_open Database Flags
|
||||
|
|
@ -334,6 +336,13 @@ int mdb_env_create(MDB_env **env);
|
|||
* at risk is governed by how often the system flushes dirty buffers to disk
|
||||
* and how often #mdb_env_sync() is called. This flag may be changed
|
||||
* at any time using #mdb_env_set_flags().
|
||||
* <li>#MDB_NOMETASYNC
|
||||
* Don't perform a synchronous flush of the meta page after committing
|
||||
* a transaction. This is similar to the #MDB_NOSYNC case, but safer
|
||||
* because the transaction data is still flushed. The meta page for any
|
||||
* transaction N will be flushed by the data flush of transaction N+1.
|
||||
* In case of a system crash, the last committed transaction may be
|
||||
* lost. This flag may be changed at any time using #mdb_env_set_flags().
|
||||
* <li>#MDB_RDONLY
|
||||
* Open the environment in read-only mode. No write operations will be allowed.
|
||||
* </ul>
|
||||
|
|
@ -392,8 +401,7 @@ void mdb_env_close(MDB_env *env);
|
|||
/** @brief Set environment flags.
|
||||
*
|
||||
* This may be used to set some flags that weren't already set during
|
||||
* #mdb_env_open(), or to unset these flags. Currently only the
|
||||
* #MDB_NOSYNC flag setting may be changed with this function.
|
||||
* #mdb_env_open(), or to unset these flags.
|
||||
* @param[in] env An environment handle returned by #mdb_env_create()
|
||||
* @param[in] flags The flags to change, bitwise OR'ed together
|
||||
* @param[in] onoff A non-zero value sets the flags, zero clears them.
|
||||
|
|
|
|||
Loading…
Reference in a new issue