erthink / libmdbx

One of the fastest embeddable key-value ACID database without WAL. libmdbx surpasses the legendary LMDB in terms of reliability, features and performance.
https://erthink.github.io/libmdbx/
Other
1.16k stars 111 forks source link

Simple careful mode for working with corrupted DB #223

Open erthink opened 3 years ago

erthink commented 3 years ago

Add MDBX_CAREFUL environment flag which engages additional checks and turns on calling mdbx_page_check() for each page fetched to a cursor stack.

This also allows us to move some of the checks that are currently performed in normal mode and which are disengageable by the MDBX_DISABLE_PAGECHECKS build option, under the control of this flag. Ideally, it is desirable to get rid of the MDBX_DISABLE_PAGECHECKS option altogether.

Next, MDBX_CAREFUL should be always engaged by all mdbx-tools, especially by mdbx_chk and by mdbx_dump with -r option (recovery).

erthink commented 3 years ago

Related to https://github.com/erthink/libmdbx/issues/217.