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