From 315e58578daca13664e3aed1f5af9557464aae90 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 1 Oct 2019 23:03:09 +0300 Subject: [PATCH] mdbx: don't log empty file read error upon creation it. Change-Id: I9cb9f9bee23817331f91ffd0847c599cf1dc0a25 --- src/elements/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index d7fa2057..14d6710f 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -5678,8 +5678,13 @@ static int __cold mdbx_read_header(MDBX_env *env, MDBX_meta *meta, meta_number, offset, (unsigned)sizeof(page), retryleft); int err = mdbx_pread(env->me_fd, &page, sizeof(page), offset); if (err != MDBX_SUCCESS) { - mdbx_error("read meta[%u,%u]: %i, %s", offset, (unsigned)sizeof(page), - err, mdbx_strerror(err)); + if (err == MDBX_ENODATA && offset == 0 && loop_count == 0 && + *filesize == 0 && (env->me_flags & MDBX_RDONLY) == 0) + mdbx_notice("read meta: empty file (%d, %s)", err, + mdbx_strerror(err)); + else + mdbx_error("read meta[%u,%u]: %i, %s", offset, (unsigned)sizeof(page), + err, mdbx_strerror(err)); return err; }