Skip to content

Commit d673127

Browse files
committed
mdbx: the set of fixes.
2026-07-27 mdbx: update ChangeLog. 2026-07-27 mdbx: minor refine `page_retire_ex()`. 2026-07-27 mdbx-doc: split/restructure ChangeLog. 2026-07-27 mdbx: fix atomics-types.h for Embarcadero C11-atomics build on Windows. 2026-07-26 mdbx++: fix stupid MSVC warning in `mdbx::slice::as_pod()`. 2026-07-26 mdbx-tests: add `issue_gh0011`. 2026-07-26 mdbx: fix extra rdt-unlock in the failure path of `dxb_resize()`. 2026-07-26 mdbx: carefully handle the returned intermediate error codes in `meta_wipe_steady()`. 2026-07-26 mdbx: fix assertion parentheses in `mdbx_txn_renew()`. 2026-07-26 mdbx-make: fix checking Bash version. 2026-07-26 mdbx: refine `page_split()` to mark new pages with `P_STICKED` until finish. 2026-07-26 mdbx: track cursors for all modify/touch operations since new spilling could be triggered from `page_alloc()`. 2026-07-25 mdbx: add internal `cursor_stack()`. 2026-07-26 mdbx: introduce `P_STICKED` and stick new subroot until attach to a tree. 2026-07-26 mdbx: fix outer-clone flags in `cursor_clone_slightly()` when source is inner. 2026-07-25 mdbx-tests: add `issue_gh0010`.
1 parent ba3fb72 commit d673127

16 files changed

Lines changed: 610 additions & 2257 deletions

ChangeLog.md

Lines changed: 17 additions & 1814 deletions
Large diffs are not rendered by default.

GNUmakefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $(error Please use GNU Make 3.81 or above)
1717
endif
1818
make_ge_4_1 := $(shell expr "$(MAKE_VERx3)" ">=" " 4 1")
1919
make_ge_4_4 := $(shell expr "$(MAKE_VERx3)" ">=" " 4 4")
20+
bash_lt_4.3 := $(shell expr "$${BASH_VERSION}" \< "4.3")
2021
SRC_PROBE_C := $(shell [ -f mdbx.c ] && echo mdbx.c || echo src/osal.c)
2122
SRC_PROBE_CXX := $(shell [ -f mdbx.c++ ] && echo mdbx.c++ || echo src/mdbx.c++)
2223
UNAME := $(shell uname -s 2>/dev/null || echo Unknown)
@@ -91,9 +92,13 @@ endif
9192
ifneq ($(make_ge_4_4),1)
9293
.NOTPARALLEL:
9394
WAIT =
94-
STOCHASTIC = echo "Skip running stochastic script since Bash service < 4.4"
9595
else
9696
WAIT = .WAIT
97+
endif
98+
99+
ifneq ($(bash_lt_4_3),0)
100+
STOCHASTIC = echo "Skip running stochastic script since Bash < 4.3"
101+
else
97102
STOCHASTIC = ./tests/stochastic.sh
98103
endif
99104

VERSION.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "git_describe": "v0.14.2-393-g2bb56af7", "git_timestamp": "2026-07-23T14:32:18+03:00", "git_tree": "4f35174d231d475c526f11bed2bb2e3c16a2a0f1", "git_commit": "2bb56af7c5ba43a3d6e1b35aac480b568ecd8916", "semver": "0.14.2.393" }
1+
{ "git_describe": "v0.14.2-422-g4e5641dd", "git_timestamp": "2026-07-27T15:51:14+03:00", "git_tree": "facdf7ae947696882632d84ad55009d02dba9126", "git_commit": "4e5641ddde88fb40e9e262d6a594a04798a05a14", "semver": "0.14.2.422" }

config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.2-393-g2bb56af7 at 2026-07-23T14:32:18+03:00),
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.2-422-g4e5641dd at 2026-07-27T15:51:14+03:00),
22
* it is the template for libmdbx's config.h
33
******************************************************************************/
44

mdbx-internals.h

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.2-393-g2bb56af7 at 2026-07-23T14:32:18+03:00).
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.2-422-g4e5641dd at 2026-07-27T15:51:14+03:00).
22
*
33
* libmdbx (aka MDBX) is an extremely fast, compact, powerful, embeddedable, transactional key-value storage engine with
44
* open-source code. MDBX has a specific set of properties and capabilities, focused on creating unique lightweight
@@ -24,7 +24,7 @@
2424

2525
#define xMDBX_ALLOY 1 /* alloyed build */
2626

27-
#define MDBX_BUILD_SOURCERY 88b82051a3cccffce9966c05fc37d1561d1483b604fd38d40bc4a8dac3faf03e_v0_14_2_393_g2bb56af7
27+
#define MDBX_BUILD_SOURCERY 624f34eebfab079ef5542c4887a13a78784c021750c63d4ed964a38ddd8cef12_v0_14_2_422_g4e5641dd
2828

2929
#define LIBMDBX_INTERNALS
3030
#define MDBX_DEPRECATED
@@ -2412,7 +2412,8 @@ MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline uint32_t osal_bswap32
24122412
/* Embarcadero Clang falls back to Dinkumware stdatomic.h on x86.
24132413
* Fix incompatible atomic_* expansions for volatile _Atomic objects:
24142414
* Dinkumware macros do (pobj)->_Atom which breaks on scalar _Atomic.
2415-
* Use Clang __c11_atomic_* builtins directly instead. */
2415+
* Use Clang __c11_atomic_* builtins directly instead.
2416+
* Provide missing fence and memory-order macros for C mode. */
24162417
#undef atomic_is_lock_free
24172418
#define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
24182419
#undef atomic_store_explicit
@@ -2424,6 +2425,14 @@ MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline uint32_t osal_bswap32
24242425
__c11_atomic_compare_exchange_strong((obj), (exp), (val), __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
24252426
#undef atomic_fetch_add
24262427
#define atomic_fetch_add(obj, val) __c11_atomic_fetch_add((obj), (val), __ATOMIC_SEQ_CST)
2428+
#undef atomic_thread_fence
2429+
#define atomic_thread_fence(ord) __c11_atomic_thread_fence(ord)
2430+
#ifndef memory_order_relaxed
2431+
#define memory_order_relaxed __ATOMIC_RELAXED
2432+
#define memory_order_acquire __ATOMIC_ACQUIRE
2433+
#define memory_order_release __ATOMIC_RELEASE
2434+
#define memory_order_seq_cst __ATOMIC_SEQ_CST
2435+
#endif
24272436
#define MDBX_HAVE_C11ATOMICS
24282437
/* #endif __CODEGEARC__ */
24292438

@@ -2677,12 +2686,13 @@ typedef enum page_type {
26772686
P_BAD = P_LEGACY_DIRTY /* explicit flag for invalid/bad page */,
26782687
P_DUPFIX = 0x20u /* for MDBX_DUPFIXED records */,
26792688
P_SUBP = 0x40u /* for MDBX_DUPSORT sub-pages */,
2689+
P_STICKED = 0x1000u /* must not be spilled */,
26802690
P_SPILLED = 0x2000u /* spilled in parent txn */,
26812691
P_LOOSE = 0x4000u /* page was dirtied then freed, can be reused */,
26822692
P_FROZEN = 0x8000u /* used for retire page with known status */,
26832693
P_TYPE = (P_BRANCH | P_LEAF | P_LARGE | P_META | P_DUPFIX | P_SUBP),
2684-
P_FLAGS = (P_BAD | P_SPILLED | P_LOOSE | P_FROZEN),
2685-
P_ILL_BITS = (uint16_t)~(P_BRANCH | P_LEAF | P_DUPFIX | P_LARGE | P_SPILLED),
2694+
P_FLAGS = (P_BAD | P_SPILLED | P_LOOSE | P_FROZEN | P_STICKED),
2695+
P_ILL_BITS = (uint16_t)~(P_BRANCH | P_LEAF | P_DUPFIX | P_LARGE | P_SPILLED | P_STICKED),
26862696

26872697
page_broken = 0,
26882698
page_large = P_LARGE,
@@ -3298,16 +3308,20 @@ __extern_C MDBX_NORETURN void panic_at_fmt(const struct MDBX_panic_point *const
32983308
ENSURE_OBJ(obj, expr); \
32993309
} while (0)
33003310

3311+
MDBX_MAYBE_UNUSED static inline const void *txn2obj(const MDBX_txn *txn) { return txn; }
3312+
MDBX_MAYBE_UNUSED static inline const void *cursor2obj(const MDBX_cursor *mc) { return mc; }
3313+
MDBX_MAYBE_UNUSED static inline const void *env2obj(const MDBX_env *env) { return env; }
3314+
33013315
#define ASSERT(expr) CHECK0(expr)
3302-
#define eASSERT0(env, expr) CHECK0_OBJ(env, expr)
3303-
#define eASSERT1(env, expr) CHECK1_OBJ(env, expr)
3304-
#define eASSERT2(env, expr) CHECK2_OBJ(env, expr)
3305-
#define tASSERT0(txn, expr) CHECK0_OBJ(txn, expr)
3306-
#define tASSERT1(txn, expr) CHECK1_OBJ(txn, expr)
3307-
#define tASSERT2(txn, expr) CHECK2_OBJ(txn, expr)
3308-
#define cASSERT0(mc, expr) CHECK0_OBJ(mc, expr)
3309-
#define cASSERT1(mc, expr) CHECK1_OBJ(mc, expr)
3310-
#define cASSERT2(mc, expr) CHECK2_OBJ(mc, expr)
3316+
#define eASSERT0(env, expr) CHECK0_OBJ(env2obj(env), expr)
3317+
#define eASSERT1(env, expr) CHECK1_OBJ(env2obj(env), expr)
3318+
#define eASSERT2(env, expr) CHECK2_OBJ(env2obj(env), expr)
3319+
#define tASSERT0(txn, expr) CHECK0_OBJ(txn2obj(txn), expr)
3320+
#define tASSERT1(txn, expr) CHECK1_OBJ(txn2obj(txn), expr)
3321+
#define tASSERT2(txn, expr) CHECK2_OBJ(txn2obj(txn), expr)
3322+
#define cASSERT0(mc, expr) CHECK0_OBJ(cursor2obj(mc), expr)
3323+
#define cASSERT1(mc, expr) CHECK1_OBJ(cursor2obj(mc), expr)
3324+
#define cASSERT2(mc, expr) CHECK2_OBJ(cursor2obj(mc), expr)
33113325

33123326
/* --------------------------------------------------------------------------------------------------------------- */
33133327

0 commit comments

Comments
 (0)