mdbx: rework page validation/checking, add MDBX_VALIDATION option (squashed).

Здесь основная часть изменений преобразующих отладочную проверку страниц
в регулярный и доступный пользователю осторожный/безопасный режим работы
с потенциально поврежденной БД.

Here the major part of the changes that transform a debugging check of
pages into a regular and user-accessible careful/safe mode for working
with a potentially corrupted database.
This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2022-06-30 21:38:32 +03:00
parent 6c5ff863ff
commit d4ef9bf233
9 changed files with 516 additions and 435 deletions

5
mdbx.h
View File

@@ -1023,6 +1023,9 @@ LIBMDBX_API void mdbx_assert_fail(const MDBX_env *env, const char *msg,
enum MDBX_env_flags_t {
MDBX_ENV_DEFAULTS = 0,
/** Extra validation of DB structure and pages content. */
MDBX_VALIDATION = UINT32_C(0x00002000),
/** No environment directory.
*
* By default, MDBX creates its environment in a directory whose pathname is
@@ -5091,7 +5094,7 @@ LIBMDBX_API int mdbx_thread_unregister(const MDBX_env *env);
* \retval 1 Transaction aborted asynchronous and reader slot
* should be cleared immediately, i.e. read transaction
* will not continue but \ref mdbx_txn_abort()
* or \ref mdbx_txn_reset() will be called later.
* nor \ref mdbx_txn_reset() will be called later.
*
* \retval 2 or great The reader process was terminated or killed,
* and libmdbx should entirely reset reader registration.