mirror of
https://github.com/isar/libmdbx.git
synced 2025-02-01 10:58:20 +08:00
mdbx: allow fastpath-commit for pure nested txns with parent-spilled pages.
Change-Id: I471fd5e057c323e3701158761631e0a9999bf54a
This commit is contained in:
parent
8fce97dca9
commit
5bb254e629
@ -8229,8 +8229,7 @@ int mdbx_txn_commit_ex(MDBX_txn *txn, MDBX_commit_latency *latency) {
|
|||||||
(parent->mt_flags & MDBX_TXN_HAS_CHILD) != 0);
|
(parent->mt_flags & MDBX_TXN_HAS_CHILD) != 0);
|
||||||
mdbx_assert(env, mdbx_dirtylist_check(txn));
|
mdbx_assert(env, mdbx_dirtylist_check(txn));
|
||||||
|
|
||||||
if (txn->tw.dirtylist->length == 0 &&
|
if (txn->tw.dirtylist->length == 0 && !(txn->mt_flags & MDBX_TXN_DIRTY) &&
|
||||||
(txn->mt_flags & (MDBX_TXN_DIRTY | MDBX_TXN_SPILLS)) == 0 &&
|
|
||||||
parent->mt_numdbs == txn->mt_numdbs) {
|
parent->mt_numdbs == txn->mt_numdbs) {
|
||||||
for (int i = txn->mt_numdbs; --i >= 0;) {
|
for (int i = txn->mt_numdbs; --i >= 0;) {
|
||||||
mdbx_tassert(txn, (txn->mt_dbistate[i] & DBI_DIRTY) == 0);
|
mdbx_tassert(txn, (txn->mt_dbistate[i] & DBI_DIRTY) == 0);
|
||||||
@ -8244,6 +8243,9 @@ int mdbx_txn_commit_ex(MDBX_txn *txn, MDBX_commit_latency *latency) {
|
|||||||
sizeof(parent->mt_geo)) == 0);
|
sizeof(parent->mt_geo)) == 0);
|
||||||
mdbx_tassert(txn, memcmp(&parent->mt_canary, &txn->mt_canary,
|
mdbx_tassert(txn, memcmp(&parent->mt_canary, &txn->mt_canary,
|
||||||
sizeof(parent->mt_canary)) == 0);
|
sizeof(parent->mt_canary)) == 0);
|
||||||
|
mdbx_tassert(txn, !txn->tw.spill_pages ||
|
||||||
|
MDBX_PNL_SIZE(txn->tw.spill_pages) == 0);
|
||||||
|
mdbx_tassert(txn, txn->tw.loose_count == 0);
|
||||||
|
|
||||||
end_mode = MDBX_END_PURE_COMMIT | MDBX_END_SLOT | MDBX_END_FREE;
|
end_mode = MDBX_END_PURE_COMMIT | MDBX_END_SLOT | MDBX_END_FREE;
|
||||||
goto done;
|
goto done;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user