mdbx: add TODO for auto-recovery.

Change-Id: I7d5fd83a2fdeaec0501ba0339bbe865d06356bad
This commit is contained in:
Leonid Yuriev 2020-07-05 00:24:15 +03:00
parent e6f5998b76
commit c22749a630

View File

@ -8371,7 +8371,12 @@ static int __cold mdbx_read_header(MDBX_env *env, MDBX_meta *dest,
(!META_IS_STEADY(dest) &&
!meta_weak_acceptable(env, dest, lck_exclusive))) {
mdbx_error("%s", "no usable meta-pages, database is corrupted");
return rc ? rc : MDBX_CORRUPTED;
if (rc == MDBX_SUCCESS) {
/* TODO: try to restore the database by fully checking b-tree structure
* for the each meta page, if the corresponding option was given */
return MDBX_CORRUPTED;
}
return rc;
}
return MDBX_SUCCESS;