mdbx-chk: allow gap for GC's PNL upto one page.

Change-Id: Ie051442947e7588b868cec35ef9374368bf8a1c4
This commit is contained in:
Leonid Yuriev 2018-09-19 17:06:56 +03:00
parent 82c975e174
commit f7bd98a4ce
2 changed files with 7 additions and 6 deletions

View File

@ -4349,11 +4349,12 @@ retry:
if (unlikely(chunk > left)) { if (unlikely(chunk > left)) {
mdbx_trace("%s: chunk %u > left %u, @%" PRIaTXN, dbg_prefix_mode, chunk, mdbx_trace("%s: chunk %u > left %u, @%" PRIaTXN, dbg_prefix_mode, chunk,
left, fill_gc_id); left, fill_gc_id);
chunk = left; if (loop < 5 || chunk - left > env->me_maxgc_ov1page) {
if (loop < 3) {
mc.mc_flags ^= C_GCFREEZE;
data.iov_len = (left + 1) * sizeof(pgno_t); data.iov_len = (left + 1) * sizeof(pgno_t);
if (loop < 21)
mc.mc_flags -= C_GCFREEZE;
} }
chunk = left;
} }
rc = mdbx_cursor_put(&mc, &key, &data, MDBX_CURRENT | MDBX_RESERVE); rc = mdbx_cursor_put(&mc, &key, &data, MDBX_CURRENT | MDBX_RESERVE);
mc.mc_flags &= ~(C_RECLAIMING | C_GCFREEZE); mc.mc_flags &= ~(C_RECLAIMING | C_GCFREEZE);

View File

@ -420,10 +420,10 @@ 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 (data->iov_len - (number + 1) * sizeof(pgno_t) > } else if (data->iov_len - (number + 1) * sizeof(pgno_t) >=
/* LY: allow gap upto half of page. it is ok /* LY: allow gap upto one page. it is ok
* and better than shink-and-retry inside mdbx_update_gc() */ * and better than shink-and-retry inside mdbx_update_gc() */
envstat.ms_psize / 2) envstat.ms_psize)
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);