v0.40.1 libmdbx new version 0.14.2 "Stormy Petre" + bindings improved
libmdbx changes
A major frontward libmdbx release with new features, refactoring and many fixes. Highlights of full changelog
New features
- Early GC Cleanup — recycled GC records are dropped as soon as possible instead of at commit, paving the way for explicit defragmentation and non-sequential GC processing.
- Database defragmentation/compaction support and the new
mdbx_defragutility. - Massive range delete:
mdbx_cursor_bunch_delete()andmdbx_cursor_delete_range()— drop adjacent items by excluding whole pages/branches from the B-tree. - New transaction primitives:
mdbx_txn_refresh(),mdbx_txn_checkpoint(),mdbx_txn_commit_embark_read(),mdbx_txn_amend(),mdbx_txn_rollback(),mdbx_txn_clone(), plus support for nested read-only transactions. - Caching getters:
mdbx_cache_get()/mdbx_cache_get_SingleThreaded(). - GC introspection:
mdbx_gc_info()for page usage and GC iteration. - Cursor scanning helpers:
mdbx_cursor_distance(),mdbx_cursor_scroll(),mdbx_cursor_distribute(). MDBX_CP_OVERWRITEfor copy API (mdbx_copy -f).MDBX_opt_split_reserveto control page fullness on split.- Branchless search + inlined default comparators (faster lookups).
- Page-fetch counters added to txn statistics (
MDBX_ENABLE_PGET_STAT). - Harmony OS (OHOS) and Haiku OS support;
libmdependency removed.
Behavior changes
- Page merge threshold default raised from 25% → 33%.
- Lock-acquire retry count tripled (fewer spurious
EAGAINon Android restart). - Windows builds now use the Win10 SDK by default.
MDBX_WANNA_RECOVERYno longer triggered when DB size is not a multiple of the VM allocation granularity (only when not a multiple of system page size).
Notable fixes
- Critical fix in
mdbx_env_resurrect_after_fork()with SysV semaphores (OSX/POSIX withMDBX_LOCKING=5) that could lead to DB corruption. - Copy API on non-Linux POSIX (mainly OSX) no longer returns spurious
EAGAIN. - Fixes for unexpected
MDBX_BAD_DBI,MDBX_DBS_FULL,SIGBUSon grown DB in nearly-full filesystems, TLS-destructor crashes, geometry auto-tuning regression, and more.
Note: upstream libmdbx repository has been relocated — sources at https://sourcecraft.dev/dqdkfa/libmdbx, docs at https://libmdbx.dqdkfa.ru.
mdbx-go binding improvements
New bindings / API
- Expose
ExactKeyValue/ExactKeyPairnavigation flags ([#217](#217)). Cursor.PutCurrentfor in-place dup replacement in DupSort tables ([#207](#207)).- Bindings for range delete (
cursor_delete_range/ bunch delete) ([#201](#201)). NoStickyThreadsenv option exposed ([#202](#202)).EnvInfo.LatterReaderTxnIDfield added ([#204](#204)).
Metrics & observability
Performance & build