diff --git a/src/mdbx.c b/src/mdbx.c index f5825df9..223279c0 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -4349,11 +4349,12 @@ retry: if (unlikely(chunk > left)) { mdbx_trace("%s: chunk %u > left %u, @%" PRIaTXN, dbg_prefix_mode, chunk, left, fill_gc_id); - chunk = left; - if (loop < 3) { - mc.mc_flags ^= C_GCFREEZE; + if (loop < 5 || chunk - left > env->me_maxgc_ov1page) { 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); mc.mc_flags &= ~(C_RECLAIMING | C_GCFREEZE); diff --git a/src/tools/mdbx_chk.c b/src/tools/mdbx_chk.c index d11bef54..ca6c56fa 100644 --- a/src/tools/mdbx_chk.c +++ b/src/tools/mdbx_chk.c @@ -420,10 +420,10 @@ static int handle_freedb(const uint64_t record_number, const MDBX_val *key, "%" PRIuSIZE " > %" PRIuSIZE " (corruption)", (number + 1) * sizeof(pgno_t), data->iov_len); number = data->iov_len / sizeof(pgno_t) - 1; - } else if (data->iov_len - (number + 1) * sizeof(pgno_t) > - /* LY: allow gap upto half of page. it is ok + } else if (data->iov_len - (number + 1) * sizeof(pgno_t) >= + /* LY: allow gap upto one page. it is ok * 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", "%" PRIuSIZE " < %" PRIuSIZE " (minor, not a trouble)", (number + 1) * sizeof(pgno_t), data->iov_len);