diff --git a/src/bits.h b/src/bits.h index fc7b939e..3d3e3921 100644 --- a/src/bits.h +++ b/src/bits.h @@ -476,8 +476,10 @@ typedef struct MDBX_lockinfo { (uint16_t)(MDBX_LOCKINFO_WHOLE_SIZE + MDBX_CACHELINE_SIZE - 1)) #define MDBX_DATA_MAGIC ((MDBX_MAGIC << 8) + MDBX_DATA_VERSION) +#define MDBX_DATA_MAGIC_DEVEL ((MDBX_MAGIC << 8) + 255) #define MDBX_LOCK_MAGIC ((MDBX_MAGIC << 8) + MDBX_LOCK_VERSION) +#define MDBX_LOCK_MAGIC_DEVEL ((MDBX_MAGIC << 8) + 255) #ifndef MDBX_ASSUME_MALLOC_OVERHEAD #define MDBX_ASSUME_MALLOC_OVERHEAD (sizeof(void *) * 2u) diff --git a/src/mdbx.c b/src/mdbx.c index e4f344ae..75505966 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -4928,7 +4928,8 @@ static int __cold mdbx_read_header(MDBX_env *env, MDBX_meta *meta, mdbx_info("meta[%u] was updated, re-read it", meta_number); } - if (page.mp_meta.mm_magic_and_version != MDBX_DATA_MAGIC) { + if (page.mp_meta.mm_magic_and_version != MDBX_DATA_MAGIC && + page.mp_meta.mm_magic_and_version != MDBX_DATA_MAGIC_DEVEL) { mdbx_error("meta[%u] has invalid magic/version %" PRIx64, meta_number, page.mp_meta.mm_magic_and_version); return ((page.mp_meta.mm_magic_and_version >> 8) != MDBX_MAGIC) @@ -6298,7 +6299,8 @@ static int __cold mdbx_setup_lck(MDBX_env *env, char *lck_pathname, env->me_lck->mti_magic_and_version = MDBX_LOCK_MAGIC; env->me_lck->mti_os_and_format = MDBX_LOCK_FORMAT; } else { - if (env->me_lck->mti_magic_and_version != MDBX_LOCK_MAGIC) { + if (env->me_lck->mti_magic_and_version != MDBX_LOCK_MAGIC && + env->me_lck->mti_magic_and_version != MDBX_LOCK_MAGIC_DEVEL) { mdbx_error("lock region has invalid magic/version"); return ((env->me_lck->mti_magic_and_version >> 8) != MDBX_MAGIC) ? MDBX_INVALID