mdbx: spill pages during prepare backlog for update_gc().

Related to https://github.com/erthink/libmdbx/issues/186

Change-Id: I88463a860da0a53420904daf1b1f39e5ca4c97e5
This commit is contained in:
Leonid Yuriev 2021-04-27 22:50:36 +03:00
parent 760cf515a7
commit 4111d7238c

View File

@ -8479,8 +8479,16 @@ static int mdbx_prep_backlog(MDBX_txn *txn, MDBX_cursor *gc_cursor,
pnl_bytes, backlog_size(txn), linear4list, backlog4cow,
backlog4rebalance);
MDBX_val fake_key, fake_val;
fake_key.iov_base = fake_val.iov_base = nullptr;
fake_key.iov_len = sizeof(txnid_t);
fake_val.iov_len = pnl_bytes;
int err = mdbx_cursor_spill(gc_cursor, &fake_key, &fake_val);
if (unlikely(err != MDBX_SUCCESS))
return err;
gc_cursor->mc_flags &= ~C_RECLAIMING;
int err = mdbx_cursor_touch(gc_cursor);
err = mdbx_cursor_touch(gc_cursor);
mdbx_trace("== after-touch, backlog %u, err %d", backlog_size(txn), err);
if (linear4list > 1 && err == MDBX_SUCCESS) {