From c22749a63042a3a04bc93ef6b5937caf7489d3f0 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 5 Jul 2020 00:24:15 +0300 Subject: [PATCH] mdbx: add TODO for auto-recovery. Change-Id: I7d5fd83a2fdeaec0501ba0339bbe865d06356bad --- src/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index ecd34972..0efcb928 100644 --- a/src/core.c +++ b/src/core.c @@ -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;