mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:14:12 +08:00
mdbx: minor clarify mmap-resize logging.
Change-Id: Ibb6e4b8ee84d03a22ad0e0d1b437989739d43bb9
This commit is contained in:
parent
75e1da1f2d
commit
537e3d18ae
15
src/core.c
15
src/core.c
@ -4747,18 +4747,18 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno,
|
|||||||
|
|
||||||
const size_t limit_bytes = pgno_align2os_bytes(env, limit_pgno);
|
const size_t limit_bytes = pgno_align2os_bytes(env, limit_pgno);
|
||||||
const size_t size_bytes = pgno_align2os_bytes(env, size_pgno);
|
const size_t size_bytes = pgno_align2os_bytes(env, size_pgno);
|
||||||
|
const size_t prev_size = env->me_dxb_mmap.current;
|
||||||
|
const size_t prev_limit = env->me_dxb_mmap.limit;
|
||||||
|
const void *const prev_addr = env->me_map;
|
||||||
|
|
||||||
mdbx_verbose("resize datafile/mapping: "
|
mdbx_verbose("resize datafile/mapping: "
|
||||||
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
||||||
"limit %" PRIuPTR " -> %" PRIuPTR,
|
"limit %" PRIuPTR " -> %" PRIuPTR,
|
||||||
env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit,
|
prev_size, size_bytes, prev_limit, limit_bytes);
|
||||||
limit_bytes);
|
|
||||||
|
|
||||||
mdbx_assert(env, limit_bytes >= size_bytes);
|
mdbx_assert(env, limit_bytes >= size_bytes);
|
||||||
mdbx_assert(env, bytes2pgno(env, size_bytes) >= size_pgno);
|
mdbx_assert(env, bytes2pgno(env, size_bytes) >= size_pgno);
|
||||||
mdbx_assert(env, bytes2pgno(env, limit_bytes) >= limit_pgno);
|
mdbx_assert(env, bytes2pgno(env, limit_bytes) >= limit_pgno);
|
||||||
const size_t prev_limit = env->me_dxb_mmap.limit;
|
|
||||||
const void *const prev_addr = env->me_map;
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
/* Acquire guard in exclusive mode for:
|
/* Acquire guard in exclusive mode for:
|
||||||
@ -4825,7 +4825,6 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno,
|
|||||||
|
|
||||||
#endif /* ! Windows */
|
#endif /* ! Windows */
|
||||||
|
|
||||||
const size_t prev_size = env->me_dxb_mmap.current;
|
|
||||||
if (size_bytes < prev_size) {
|
if (size_bytes < prev_size) {
|
||||||
mdbx_notice("resize-MADV_%s %u..%u",
|
mdbx_notice("resize-MADV_%s %u..%u",
|
||||||
(env->me_flags & MDBX_WRITEMAP) ? "REMOVE" : "DONTNEED",
|
(env->me_flags & MDBX_WRITEMAP) ? "REMOVE" : "DONTNEED",
|
||||||
@ -4908,14 +4907,12 @@ bailout:
|
|||||||
mdbx_error("failed resize datafile/mapping: "
|
mdbx_error("failed resize datafile/mapping: "
|
||||||
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
||||||
"limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d",
|
"limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d",
|
||||||
env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit,
|
prev_size, size_bytes, prev_limit, limit_bytes, rc);
|
||||||
limit_bytes, rc);
|
|
||||||
} else {
|
} else {
|
||||||
mdbx_warning("unable resize datafile/mapping: "
|
mdbx_warning("unable resize datafile/mapping: "
|
||||||
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
"present %" PRIuPTR " -> %" PRIuPTR ", "
|
||||||
"limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d",
|
"limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d",
|
||||||
env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit,
|
prev_size, size_bytes, prev_limit, limit_bytes, rc);
|
||||||
limit_bytes, rc);
|
|
||||||
}
|
}
|
||||||
if (!env->me_dxb_mmap.address) {
|
if (!env->me_dxb_mmap.address) {
|
||||||
env->me_flags |= MDBX_FATAL_ERROR;
|
env->me_flags |= MDBX_FATAL_ERROR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user