mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
mdbx: refine update_gc() for small pages with huge transactions.
Change-Id: I66080e11a780a6a711691918179bc21d9a121347
This commit is contained in:
parent
d3e609d7ff
commit
78e592579a
14
src/core.c
14
src/core.c
@ -6917,13 +6917,15 @@ static int mdbx_update_gc(MDBX_txn *txn) {
|
||||
txn->mt_cursors[FREE_DBI] = &couple.outer;
|
||||
|
||||
retry:
|
||||
++loop;
|
||||
retry_noaccount:
|
||||
mdbx_trace("%s", " >> restart");
|
||||
mdbx_tassert(
|
||||
txn, mdbx_pnl_check4assert(txn->tw.reclaimed_pglist, txn->mt_next_pgno));
|
||||
mdbx_tassert(txn, mdbx_dirtylist_check(txn));
|
||||
mdbx_tassert(txn, txn->tw.dirtyroom + txn->tw.dirtylist->length ==
|
||||
MDBX_DPL_TXNFULL);
|
||||
if (unlikely(/* paranoia */ ++loop > 42)) {
|
||||
if (unlikely(/* paranoia */ loop > ((MDBX_DEBUG > 0) ? 9 : 99))) {
|
||||
mdbx_error("too more loops %u, bailout", loop);
|
||||
rc = MDBX_PROBLEM;
|
||||
goto bailout;
|
||||
@ -7144,7 +7146,9 @@ retry:
|
||||
if (unlikely(amount != MDBX_PNL_SIZE(txn->tw.reclaimed_pglist))) {
|
||||
mdbx_trace("%s.reclaimed-list changed %u -> %u, retry", dbg_prefix_mode,
|
||||
amount, (unsigned)MDBX_PNL_SIZE(txn->tw.reclaimed_pglist));
|
||||
goto retry /* rare case, but avoids GC fragmentation and one loop. */;
|
||||
goto retry_noaccount /* rare case, but avoids GC fragmentation and one
|
||||
cycle. */
|
||||
;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -7389,7 +7393,7 @@ retry:
|
||||
unlikely(amount < MDBX_PNL_SIZE(txn->tw.reclaimed_pglist))) {
|
||||
mdbx_notice("** restart: reclaimed-list growth %u -> %u", amount,
|
||||
(unsigned)MDBX_PNL_SIZE(txn->tw.reclaimed_pglist));
|
||||
goto retry;
|
||||
goto retry_noaccount;
|
||||
}
|
||||
|
||||
continue;
|
||||
@ -7490,8 +7494,8 @@ retry:
|
||||
|
||||
if (unlikely(txn->tw.loose_count ||
|
||||
amount != MDBX_PNL_SIZE(txn->tw.reclaimed_pglist))) {
|
||||
mdbx_notice("** restart: reclaimed-list changed (%u -> %u, %u)", amount,
|
||||
MDBX_PNL_SIZE(txn->tw.reclaimed_pglist),
|
||||
mdbx_notice("** restart: reclaimed-list growth (%u -> %u, loose +%u)",
|
||||
amount, MDBX_PNL_SIZE(txn->tw.reclaimed_pglist),
|
||||
txn->tw.loose_count);
|
||||
goto retry;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user