mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 05:28:21 +08:00
mdbx: allow mixind with/without MDBX_WRITEMAP for the same database.
Change-Id: I916bb9e9b44a58cf78786e76a8c42d62e0bfc579
This commit is contained in:
parent
171a254425
commit
0fc2d39cce
14
mdbx.h
14
mdbx.h
@ -999,9 +999,6 @@ LIBMDBX_API const char *mdbx_dump_val(const MDBX_val *key, char *const buf,
|
|||||||
* database pages and more work for tracking ones, which neuters a
|
* database pages and more work for tracking ones, which neuters a
|
||||||
* performance boost caused by the MDBX_WRITEMAP mode.
|
* performance boost caused by the MDBX_WRITEMAP mode.
|
||||||
*
|
*
|
||||||
* NOTE: MDBX don't allow to mix processes with and without MDBX_WRITEMAP on
|
|
||||||
* the same environment. In such case MDBX_INCOMPATIBLE will be generated.
|
|
||||||
*
|
|
||||||
* - with MDBX_WRITEMAP = all data will be mapped into memory in the read-write
|
* - with MDBX_WRITEMAP = all data will be mapped into memory in the read-write
|
||||||
* mode. This offers a significant performance benefit, since the data will
|
* mode. This offers a significant performance benefit, since the data will
|
||||||
* be modified directly in mapped memory and then flushed to disk by
|
* be modified directly in mapped memory and then flushed to disk by
|
||||||
@ -1611,9 +1608,9 @@ LIBMDBX_API int mdbx_env_create(MDBX_env **penv);
|
|||||||
* NOTE: MDB_NOLOCK flag don't supported by MDBX,
|
* NOTE: MDB_NOLOCK flag don't supported by MDBX,
|
||||||
* try use MDBX_EXCLUSIVE as a replacement.
|
* try use MDBX_EXCLUSIVE as a replacement.
|
||||||
*
|
*
|
||||||
* NOTE: MDBX don't allow to mix processes with different MDBX_WRITEMAP,
|
* NOTE: MDBX don't allow to mix processes with different MDBX_SAFE_NOSYNC,
|
||||||
* MDBX_SAFE_NOSYNC, MDBX_NOMETASYNC, MDBX_MAPASYNC flags on the same
|
* MDBX_NOMETASYNC, MDBX_MAPASYNC flags on the same environment.
|
||||||
* environment. In such case MDBX_INCOMPATIBLE will be returned.
|
* In such case MDBX_INCOMPATIBLE will be returned.
|
||||||
*
|
*
|
||||||
* If the database is already exist and parameters specified early by
|
* If the database is already exist and parameters specified early by
|
||||||
* mdbx_env_set_geometry() are incompatible (i.e. for instance, different page
|
* mdbx_env_set_geometry() are incompatible (i.e. for instance, different page
|
||||||
@ -1637,9 +1634,8 @@ LIBMDBX_API int mdbx_env_create(MDBX_env **penv);
|
|||||||
* or the current process tries to open environment
|
* or the current process tries to open environment
|
||||||
* more than once.
|
* more than once.
|
||||||
* - MDBX_INCOMPATIBLE = Environment is already opened by another process,
|
* - MDBX_INCOMPATIBLE = Environment is already opened by another process,
|
||||||
* but with different set of MDBX_WRITEMAP,
|
* but with different set of MDBX_SAFE_NOSYNC,
|
||||||
* MDBX_SAFE_NOSYNC, MDBX_NOMETASYNC, MDBX_MAPASYNC
|
* MDBX_NOMETASYNC, MDBX_MAPASYNC flags.
|
||||||
* flags.
|
|
||||||
* Or if the database is already exist and
|
* Or if the database is already exist and
|
||||||
* parameters specified early by
|
* parameters specified early by
|
||||||
* mdbx_env_set_geometry() are incompatible (i.e.
|
* mdbx_env_set_geometry() are incompatible (i.e.
|
||||||
|
@ -10189,8 +10189,7 @@ int __cold mdbx_env_open(MDBX_env *env, const char *pathname, unsigned flags,
|
|||||||
goto bailout;
|
goto bailout;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned rigorous_flags =
|
const unsigned rigorous_flags = MDBX_SAFE_NOSYNC | MDBX_MAPASYNC;
|
||||||
MDBX_WRITEMAP | MDBX_SAFE_NOSYNC | MDBX_MAPASYNC;
|
|
||||||
const unsigned mode_flags = rigorous_flags | MDBX_NOMETASYNC |
|
const unsigned mode_flags = rigorous_flags | MDBX_NOMETASYNC |
|
||||||
MDBX_LIFORECLAIM | MDBX_COALESCE | MDBX_NORDAHEAD;
|
MDBX_LIFORECLAIM | MDBX_COALESCE | MDBX_NORDAHEAD;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user