From 9f2d30c1a901df457748f1bab1d4410f0c475c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 2 Dec 2022 10:27:13 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=B0?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=BD=D1=83=D1=82=D1=80=D0=B8=20`env=5Fsync()`?= =?UTF-8?q?=20=D0=B5=D1=81=D0=BB=D0=B8=20=D1=8D=D1=82=D0=BE=20=D1=82=D1=80?= =?UTF-8?q?=D0=B5=D0=B1=D1=83=D0=B5=D1=82=D1=81=D1=8F=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=81=D0=B1=D1=80=D0=BE=D1=81=D0=B0=20=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=BD=D0=B0=20=D0=B4=D0=B8=D1=81=D0=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core.c b/src/core.c index b5d959af..7b1b3d17 100644 --- a/src/core.c +++ b/src/core.c @@ -7646,6 +7646,15 @@ retry:; goto bailout; } + if (!inside_txn && locked && (env->me_flags & MDBX_WRITEMAP) && + unlikely(head.ptr_c->mm_geo.next > + bytes2pgno(env, env->me_dxb_mmap.current))) { + rc = map_resize_implicit(env, head.ptr_c->mm_geo.next, + head.ptr_c->mm_geo.now, head.ptr_c->mm_geo.upper); + if (unlikely(rc != MDBX_SUCCESS)) + goto bailout; + } + const size_t autosync_threshold = atomic_load32(&env->me_lck->mti_autosync_threshold, mo_Relaxed); const uint64_t autosync_period =