mdbx: allow GC's PNL be partially unused.

This commit is contained in:
Leonid Yuriev 2018-09-03 14:27:38 +03:00 committed by Leo Yuriev
parent 6fb628d88d
commit 64fb9b81f3
2 changed files with 3 additions and 2 deletions

View File

@ -2375,7 +2375,7 @@ static int mdbx_page_alloc(MDBX_cursor *mc, unsigned num, MDBX_page **mp,
/* Append PNL from FreeDB record to me_reclaimed_pglist */ /* Append PNL from FreeDB record to me_reclaimed_pglist */
mdbx_cassert(mc, (mc->mc_flags & C_GCFREEZE) == 0); mdbx_cassert(mc, (mc->mc_flags & C_GCFREEZE) == 0);
pgno_t *re_pnl = (pgno_t *)data.iov_base; pgno_t *re_pnl = (pgno_t *)data.iov_base;
mdbx_tassert(txn, data.iov_len == MDBX_PNL_SIZEOF(re_pnl)); mdbx_tassert(txn, data.iov_len >= MDBX_PNL_SIZEOF(re_pnl));
mdbx_tassert(txn, mdbx_pnl_check(re_pnl, false)); mdbx_tassert(txn, mdbx_pnl_check(re_pnl, false));
repg_pos = MDBX_PNL_SIZE(re_pnl); repg_pos = MDBX_PNL_SIZE(re_pnl);
if (!repg_list) { if (!repg_list) {

View File

@ -420,7 +420,8 @@ static int handle_freedb(const uint64_t record_number, const MDBX_val *key,
"%" PRIuSIZE " > %" PRIuSIZE " (corruption)", "%" PRIuSIZE " > %" PRIuSIZE " (corruption)",
(number + 1) * sizeof(pgno_t), data->iov_len); (number + 1) * sizeof(pgno_t), data->iov_len);
number = data->iov_len / sizeof(pgno_t) - 1; number = data->iov_len / sizeof(pgno_t) - 1;
} else if ((number + 1) * sizeof(pgno_t) < data->iov_len) } else if (data->iov_len - (number + 1) * sizeof(pgno_t) >
sizeof(pgno_t) * 2)
problem_add("entry", record_number, "extra idl space", problem_add("entry", record_number, "extra idl space",
"%" PRIuSIZE " < %" PRIuSIZE " (minor, not a trouble)", "%" PRIuSIZE " < %" PRIuSIZE " (minor, not a trouble)",
(number + 1) * sizeof(pgno_t), data->iov_len); (number + 1) * sizeof(pgno_t), data->iov_len);