mdbx: fix mdbx_env_compact() hand when DB is corrupted or the volume of an output pages aliquot to MDBX_ENVCOPY_WRITEBUF.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-07-01 11:37:13 +03:00
parent 7b735c272d
commit 0b5cdee6ef

View File

@ -19557,7 +19557,8 @@ __cold static int mdbx_env_compact(MDBX_env *env, MDBX_txn *read_txn,
}
if (rc == MDBX_SUCCESS)
rc = mdbx_env_cwalk(&ctx, &root, 0);
mdbx_env_cthr_toggle(&ctx);
if (ctx.mc_wlen[ctx.mc_head & 1])
mdbx_env_cthr_toggle(&ctx);
mdbx_env_cthr_toggle(&ctx);
thread_err = mdbx_thread_join(thread);
mdbx_assert(env, (ctx.mc_tail == ctx.mc_head &&