mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-15 22:34:30 +08:00
mdbx: логирование и возврат MDBX_INCOMPATIBLE
при попытке запуска вложенных транзакций в режиме MDBX_WRITEMAP
.
This commit is contained in:
parent
0a364aefbb
commit
dc98f06d2c
@ -199,8 +199,13 @@ int mdbx_txn_begin_ex(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, M
|
||||
if (parent) {
|
||||
/* Nested transactions: Max 1 child, write txns only, no writemap */
|
||||
rc = check_txn_rw(parent, MDBX_TXN_RDONLY | MDBX_WRITEMAP | MDBX_TXN_BLOCKED);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS)) {
|
||||
if (rc == MDBX_BAD_TXN && (parent->flags & (MDBX_TXN_RDONLY | MDBX_TXN_BLOCKED)) == 0) {
|
||||
ERROR("%s mode is incompatible with nested transactions", "MDBX_WRITEMAP");
|
||||
rc = MDBX_INCOMPATIBLE;
|
||||
}
|
||||
return LOG_IFERR(rc);
|
||||
}
|
||||
|
||||
if (env->options.spill_parent4child_denominator) {
|
||||
/* Spill dirty-pages of parent to provide dirtyroom for child txn */
|
||||
|
Loading…
x
Reference in New Issue
Block a user