Closed AskAlexSharov closed 3 years ago
Just an idea: maybe this check even can be done when db open (I saw it has some recovery step) - because it's fast. And just automatically choose meta-page with good Main dbi ("good" in terms of ! invalid page txnid (67410) for parent-page' txnid (67408)
check).
No.
Automatic switching is allowed only in cases when it is expected by the user and the confidence that it will not cause harm. Thus only a rollback from weak to steady meta-page is allowed automatically. No options.
In all other cases, a complete DB check is required, because otherwise it is impossible to ensure the absence of corruption. I.e. presence of errors during reduced check means that a database broken, but ones absence does not give any guarantees.
How about moving this check from end to start of mdbx_chk?
How about moving this check from end to start of mdbx_chk?
No, since this is unreasonable. In general, for a complete check, it is always necessary to first walk a page tree, and only if successful, then walk an entries via cursor.
However, with this database I saw a problem related to #238, i.e. seems that:
v0.10.5
;v0.10.5
;and at the the end have checked it by mdbx_chk v0.10.5
.
At a whole this gave a false-positive diagnosis of database corruption - I'll think about what to do.
At a whole this gave a false-positive diagnosis of database corruption - I'll think about what to do.
@AskAlexSharov, any ideas are welcome.
for a complete check
- yes, but before complete check and switch meta-page - there is another step "to find which meta-page are for sure bad, and don't run complete check for them", because complete check is long. But i'm fine with "no".
Example long-running mdbx_chk which I interrupted by Ctrl+C in the middle:
As you can see, error
! corrupted leaf-page #77581853, mod-txnid 67410
was found at the end. Is it possible to move (or add) this check (of Main dbi) to the start of mdbx_chk work?Main dbi is small - likely it will be cheap. But, such move will allow mdbx_chk "fail fast" on this scenarios. (to find good meta-page faster).