Skip to content

v0.40.1 libmdbx new version 0.14.2 "Stormy Petre" + bindings improved

Choose a tag to compare

@JkLondon JkLondon released this 14 May 20:39

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_defrag utility.
  • Massive range delete: mdbx_cursor_bunch_delete() and mdbx_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_OVERWRITE for copy API (mdbx_copy -f).
  • MDBX_opt_split_reserve to 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; libm dependency removed.

Behavior changes

  • Page merge threshold default raised from 25% → 33%.
  • Lock-acquire retry count tripled (fewer spurious EAGAIN on Android restart).
  • Windows builds now use the Win10 SDK by default.
  • MDBX_WANNA_RECOVERY no 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 with MDBX_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, SIGBUS on 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 / ExactKeyPair navigation flags ([#217](#217)).
  • Cursor.PutCurrent for in-place dup replacement in DupSort tables ([#207](#207)).
  • Bindings for range delete (cursor_delete_range / bunch delete) ([#201](#201)).
  • NoStickyThreads env option exposed ([#202](#202)).
  • EnvInfo.LatterReaderTxnID field added ([#204](#204)).

Metrics & observability

Performance & build

  • Cursor.Put: reduce cgo heap-pointer overhead ([#205](#205)).
  • Ensure MDBX_USE_FALLOCATE is enabled in the build ([#203](#203)).
  • FD reviving fix ([#200](#200)).
  • Env.Path() method fixed ([#198](#198)).