diff --git a/src/txn-nested.c b/src/txn-nested.c index f5edfb37..c6c728f1 100644 --- a/src/txn-nested.c +++ b/src/txn-nested.c @@ -326,7 +326,6 @@ static void txn_merge(MDBX_txn *const parent, MDBX_txn *const txn, const size_t tASSERT(parent, dpl_check(parent)); } - parent->flags &= ~MDBX_TXN_HAS_CHILD; if (parent->wr.spilled.list) { assert(pnl_check_allocated(parent->wr.spilled.list, (size_t)parent->geo.first_unallocated << 1)); if (MDBX_PNL_GETSIZE(parent->wr.spilled.list)) @@ -459,9 +458,6 @@ void txn_nested_abort(MDBX_txn *nested) { parent->wr.retired_pages = nested->wr.retired_pages; } - parent->wr.dirtylru = nested->wr.dirtylru; - parent->nested = nullptr; - parent->flags &= ~MDBX_TXN_HAS_CHILD; tASSERT(parent, dpl_check(parent)); tASSERT(parent, audit_ex(parent, 0, false) == 0); dpl_release_shadows(nested); @@ -581,9 +577,10 @@ int txn_nested_join(MDBX_txn *txn, struct commit_timestamp *ts) { ts->sync = /* no sync */ ts->write; } txn_merge(parent, txn, parent_retired_len); + tASSERT(parent, parent->flags & MDBX_TXN_HAS_CHILD); + parent->flags -= MDBX_TXN_HAS_CHILD; env->txn = parent; parent->nested = nullptr; - parent->flags &= ~MDBX_TXN_HAS_CHILD; tASSERT(parent, dpl_check(parent)); #if MDBX_ENABLE_REFUND diff --git a/src/txn.c b/src/txn.c index 5d553595..321e9a52 100644 --- a/src/txn.c +++ b/src/txn.c @@ -352,7 +352,10 @@ int txn_end(MDBX_txn *txn, unsigned mode) { tASSERT(txn, pnl_check_allocated(txn->wr.repnl, txn->geo.first_unallocated - MDBX_ENABLE_REFUND)); tASSERT(txn, memcmp(&txn->wr.troika, &parent->wr.troika, sizeof(troika_t)) == 0); tASSERT(txn, mode & TXN_END_FREE); + tASSERT(parent, parent->flags & MDBX_TXN_HAS_CHILD); env->txn = parent; + parent->nested = nullptr; + parent->flags -= MDBX_TXN_HAS_CHILD; const pgno_t nested_now = txn->geo.now, nested_upper = txn->geo.upper; txn_nested_abort(txn);