Skip to content

Releases: Mithril-mine/libmdbx

libmdbx v0.14.3 "Китов" (Kitov)

Choose a tag to compare

@erthink erthink released this 09 Aug 19:57
Immutable release. Only release title and notes can be modified.
v0.14.3
f7a3a93

The supporting release with a lot of bug fixes,
in memory of Anatoly Kitov, a pioneer of cybernetics and the one of inventors of M-100, which was a most powerful computer of the World in 1958.

558 commits, 227 files changed, 9482 insertions(+), 6496 deletions(-).

Important:

  • Starting from v0.14.3, the 0.14.x branch gets stable status and will only receive bug fixes, but other improvements only in exceptional cases.
    Further development will be continued under the 0.15.x branch.

Appreciations:

Backward compatibility breaks:

  • Now API functions that do not receive a transaction in arguments, but require a write lock, always checks that the current thread owns (launched) the writing transaction.
    If the current thread does NOT own the writing transaction (did not start it), then the write-transaction lock will be acquired.
    This can lead to deadlock in MDBX_NOSTICKYTHREADS mode!

    These functions include:

    • mdbx_env_set_flags(), mdbx_env_set_option();
    • mdbx_env_set_geometry();
    • mdbx_env_sync_ex(), mdbx_env_sync(), mdbx_env_sync_poll();
    • mdbx_env_stat(), mdbx_env_stat_ex() when called with txn=nullptr;
    • mdbx_env_defrag(), mdbx_env_close_ex(), mdbx_env_close();

    Deadlock in MDBX_NOSTICKYTHREADS mode can only occur when a writing transaction is started in one thread, and a synchronous call to one of the listed above functions is performed in the other, in a context that prevents the completion of a running writing transaction:

    • a writing transaction has been started, and an application logic of its completion is waiting for some work to be done by other threads;
    • one of these threads, which must be done before completing the writing transaction, calls one of the specified functions;
    • deadlock: such a thread will wait for the completion of the transaction, and the thread will wait on the lock, which will be released upon completion of the transaction.
  • Some deprecated enums and defines were removed from API.

  • On Windows platform the Windows-10 API is now used by default.
    Previous versions are still supported, but now they should be explicitly requested during library build by defining _WIN32_WINNT.

  • Restructured project directories, renamed ut_and_examples into examples, etc.

  • The mdbx_replace_ex() now returns only previous data from a DB, but never new ones, even it has the same value.

Improvements:

  • Deferred invalidation of the dbi-handles of dropped tables has been implemented until the corresponding transactions are committed.

    Previously, libmdbx implemented the behavior historically inherited from LMDB, when handles of a dropped tables were immediately closed, regardless of the possible subsequent abortion of such transactions.
    Now, when tables are dropped, both ones associated handles and data remain available for other transactions running in parallel within the current process.

    This improvement has been asking for a long time, but it required a lot of preparation and refactoring which are done step-by-step during a few last releases.

  • Embarcadero C++ Builder now could be used to build libmdbx on Windows.

  • Allowed to use cursors bonded to the same table/DBI, but to different read-only transaction, in an API with multiple cursors in the parameters.

  • Added the missing recipe for Conan to an amalgamated source code.

  • Added check-and-retry of presync-to-disk condition to avoid latency spikes in commit path during asynchronous calls of mdbx_env_sync(), mdbx_env_sync_ex(), mdbx_env_sync_poll().

  • Added the MDBX_opt_presync_threshold option.

  • In the C++ API the move assignment operator of the mdbx::buffer<> template now supports the case of unequal allocators by copying the contents of a source.

  • Added adjustment of the maximum size of the database and memory mapping in the modes of using Valgrind or AddressSanitizer, which greatly simplifies the use of these tools.

  • For Windows, the MDBX_WITHOUT_MSVC_CRT=ON build mode has been significantly improved using ntdll functions to eliminate dependence on MSVC CRT.
    Among other things, now there is a replacement for the __try/__except/__finally operators, support for Structural Exception Handling in the SAFESEH mode, simple substitution of _load_config_used, etc.

  • Provided CI on SourceCraft and GitHub.

  • Refined handling MDBX_BUILD_OPTIONS in the GNUmakefile to avoid redefinition/overriding.

  • On Windows provided mdbx_env_deleteA() and define mdbx_env_deleteT() depend on the UNICODE.

  • Added /experimental:c11atomics workaround for MSVC compiler weakness to enable C11 atomics.

Fixes:

  • Fixed the issue of losing a table content after abortion the nested transaction where such table was dropped.

  • Fixed ERROR_LOCK_VIOLATION during defrag on Windows in operation modes using overlapped I/O.

  • Fixed the regression/bug in the copy-without-compaction code, which leads to produce a copy without a payload.

  • Fixed env_owned_wrtxn() to avoid by-pass locking in the MDBX_NOSTICKYTHREADS mode.

  • Fixed unreasonably high memory 2GB consumption in mdbx_load utility due to leftover debug changes.

  • Fixed loss of mincore() cache due erase/overwrite on insert.

  • Fixed a lot of typos and a few bugs detected by CodeQL.

  • Fixed loosing of global init and thread-local-storage destructors in static library build by MinGW toolchain in particular cases.

  • Fixed major spilling (writing a dirty/modified pages in a large transaction to free RAM) regression.

  • Fixed a few bugs and resource leaks related to error handling in rare particular conditions.

  • Fixed a set of bugs and flaws in C++ API.

  • Other minor bugs and omissions.

For more information please see ChangeLog.

libmdbx v0.14.2 "Буревестник" (Stormy Petrel)

Choose a tag to compare

@erthink erthink released this 14 May 19:10
Immutable release. Only release title and notes can be modified.
v0.14.2
c8780ae

The frontward release with new major features and internal refactoring.

609 commits, 209 files changed, 29521 insertions(+), 15701 deletions(-)

Important:

  • Due to numerous user requests, this ChangeLog will be kept in English.
    However, it should be noted that it was originally provided in Russian and then translated by AI during the formation of the release, because of this, there may be flaws in the text.

  • Since 2026 libmdbx project has changed its code development and distribution model.
    To get acquainted with important changes and plans, we recommend reading the compact presentation "libmdbx: successes, obstacles, goals and roadmap", which contains important explanations in the form of embedded comments.

  • The upstream of libmdbx project has been relocated to the jurisdiction of the Russian Federation.
    We are confident that this will protect the project from any sanctions and ensure its accessibility to all users around the world.
    Please use https://libmdbx.dqdkfa.ru for documentation and https://sourcecraft.dev/dqdkfa/libmdbx for the source code.
    Nonetheless libmdbx is still open source and provided with first-class free support.

Appreciations:

Backward compatibility breaks:

  • The typedefs of the various callbacks are now unified and includes an asterisk of indirection in C syntax notation.
    Perhaps this is the most annoying change that breaks the builds and requires changing your code. However, it is necessary to restore order.
    In most cases, the required changes are limited to removing the * chars after a callback type(s).

  • The size and composition of the MDBX_envinfo structure has been changed, and the mdbx_env_info_ex() function no longer supports the old versions. This breaks the compatibility of the ABI with older versions of the library, but preserves API compatibility at the source code level.

  • The template mdbx::buffer<ALLOCATOR, POLICY> is now inherited from mdbx::slice and mdbx::buffer_tag, which simplified the C++ API and the use of the meta-programming approach.

  • When building using GNU Make and CMake now, instead of a single config.h, different config-gnumake.h and config-cmake.h files are generated.

  • It is forbidden to open existing tables with different flags, unless the MDBX_DB_ACCEDE option is explicitly set.

  • The dumps generated by the mdbx_dump utility no longer output the current size of the database and maxreaders, so that the contents of the dump depend only on the contents of the database.

  • The build option MDBX_FORCE_ASSERTIONS has been deprecated, and MDBX_CHECKING (within range of -1..3) should be used instead.

  • The NDEBUG macro, which is generally accepted in C, no longer affects assert checks inside the library, but retains its traditional influence on assert checks related to argument control in the inline methods of the C++ API.

New features:

  • Implemented "Early GC Cleanup".

    Now the recycled GC records are deleted not when the writing transaction is committed, but as soon as possible. This opens the way to the implementation of explicit defragmentation (without copying the database) and further to non-sequential GC processing (which will eliminate the problem of DB swelling/overflow due to GC processing stopping during long-term reading transactions).

    The amount of overhead is now proportional to the volume of operations performed. Therefore, in most scenarios, the overhead is slightly less, but on the contrary, a little more when canceling nested transactions.

  • Database defragmentation/compaction support has been implemented and the mdbx_defrag utility has been added with a set of command-line options that allow you to define key parameters and defragmentation limits.

  • API Extension:

    • the MDBX_CP_OVERWRITE option has been added to the database copy function (overwriting the target file), and the mdbx_copy utility has a similar command-line option -f.
    • added the functions mdbx_cursor_bunch_delete() and mdbx_cursor_delete_range(), which perform massive deletion of adjacent elements much faster by excluding pages and branches with deleted items from a B-tree entirely.
    • added data retrieval functions with "caching" the mdbx_cache_get() and mdbx_cache_get_SingleThreaded().
    • added the mdbx_txn_refresh() function to quickly refresh the reading transaction.
    • added the mdbx_txn_checkpoint() function to commit write transaction without releasing locks.
    • added the mdbx_txn_commit_embark_read() function to commit a writing transaction and start a reading one without interfering with other changes.
    • added the mdbx_txn_amend() function to change data starting from a snapshot of the data used in a given read transaction.
    • added the mdbx_txn_rollback() function to abort and restart a transaction with the cancellation of all changes, but without releasing locks.
    • added support for cloning reading transactions using mdbx_txn_clone().
    • added support for nested read-only transactions.
    • added the mdbx_gc_info() function to get information about GC, page usage, and the ability to iterate GC content.
    • added the mdbx_env_defrag() function for explicit DB defragmentation, as well as the mdbx_defrag utility.
    • added the MDBX_opt_split_reserve option to control the fullness of tree pages when splitting them.
    • added the functions mdbx_cursor_distance(), mdbx_cursor_scroll() and mdbx_cursor_distribute() to simplify multithreaded parallel scanning.
  • Support for Harmony OS (OHOS) and Haiku OS.

  • Floating-point operations are no longer used both inside the library and in utilities, and linking to libm has been removed from build scripts.

  • It is possible to set debugging options MDBX_DBG_ASSERT, MDBX_DBG_AUDIT and others through environment variables. However, the corresponding debugging capabilities still need to be activated during the build.

  • Expanded and redesigned the composition of information generated by the function mdbx_chk_env() and the output utility mdbx_chk.

  • The main libmdbx repository has been migrated from GitFlic to SourceCraft.

    For my part, I am saddened by the need to perform such manipulations, because they create significant inconvenience to users, but (unfortunately) there are sufficient reasons for this:

    • Instead of the promised internationalization, GitFlic has only a Russian-language localization with a lot of technical features that make it difficult to use machine translation systems. This made it impossible for many users to use the service and generated a number of legitimate complaints/reproaches, including from developers from China, Brazil, Korea, Iran, etc.
    • In the three years since migrating to GitFlic, several outrageous errors in the markdown editor have not been fixed, which turned the design of releases into an annoying struggle. In addition, the development roadmap has disappeared from the public space. In total, this forced me to abandon GitFlic.
  • The number of page receiving/loading operations has been added to the transaction statistics, which makes it possible to quantify the amount of work with cursors and the effectiveness of various indexing and data retrieval approaches.
    The collection of relevant statistics is controlled by the additional build option MDBX_ENABLE_PGET_STAT.

  • The command-line options -b number, -L megabytes, -d percent and -G geometry have been added to the mdbx_load utility, allowing you to set the size of batch inserts, limit the volume of transactions, set the desired page filling density and redefine the geometry of the database when loading data from a dump.

  • Search was accelerated by using a branchless algorithm and embedding code of built-in/default comparators.

  • Redesigned internal verification statements and related build options.
    At the same time, NDEBUG no longer affects checks in the main engine code, which eliminates the causes of unexpected performance drops due to the lack of a definition of NDEBUG in non-debugging builds of users.

    The checks are divided into three categories (cheap, medium, expensive), controlled by the build option MDBX_CHECKING, which takes values from -1 to 3 inclusive.
    The value of 3 corresponds to the maximum number of checks, and -1 disables both all assert() and ENSURE() checks.
    By default, MDBX_CHECKING is assumed to be equal to the MDBX_DEBUG option, which in turn defaults to 0, which corresponds to a regular (non-debugging) library build.
    This way, compatibility with the previous behavior is maintained and at the same time precise control of debugging checks is ensured.

Behavior change:

  • Re-enabled/enabled on older Linux kernels, starting with version 3.16, since now there is no reason to stop working on 3.16 while supporting 4.x kernels, an...
Read more

libmdbx v0.13.12 "Аврора" (Aurora)

Choose a tag to compare

@erthink erthink released this 30 Apr 14:43
Immutable release. Only release title and notes can be modified.
v0.13.12
5315e99

The supporting release of a stable branch with bug fixes.

git diff' stat: 20 files changed, 191 insertions(+), 215 deletions(-)

Appreciations:

Important:

  • libmdbx project has changed its code development and distribution model.
    To get acquainted with important changes and plans, we recommend reading the compact presentation "libmdbx: successes, obstacles, goals and roadmap", which contains important explanations in the form of embedded comments.

  • At a many requests of users, the change log now is kept in English.

Fixes:

  • Fixed the counting of nested trees in the mdbx_chk tool for a multi-values/dupsort hives (backport).
  • Fixed swapping the shrink/growth parameters in a DB-geometry in the mdbx_load utility (backport).
  • Fixed SIGSEGV in the case when all meta pages are not entirely usable (backport).
  • Fixed information collection via kstat() for bootid on Solaris and related platforms (backport).
  • Fixed a typo in the ST_EXPORTED processing path that broke the build on platforms where the mentioned flag is defined for fstatvfs() (backport).
  • Fixed missing error handling of NtUnmapViewOfSection() and munmap() inside osal_munmap() (backport).
  • Fixed SIGSEGV due to an attempt to clean/overwrite a corrupted meta page when opening the database in read-only mode (backport).
  • Fixed returning a wrong/uninitialized ms_psize field when using mdbx_enumerate_tables() (backport).
  • Fixed adjusting of neighbor nested cursors after a dupsort item deletion (backport).

Other:

  • The dumps generated by the mdbx_dump utility no longer contains the current size of a DB and maxreaders parameter, so that the contents of a dump depend only on a payload data.
  • Cutoff packages/ into the separate aside repository.

Downloads:


For more information please see ChangeLog in the stable branch.

libmdbx v0.13.11 "A7A5" (just as Stable)

Choose a tag to compare

@erthink erthink released this 30 Jan 14:55
Immutable release. Only release title and notes can be modified.
v0.13.11
1d115d3

The supporting release of a stable branch with bug fixes.

git diff' stat: 159 files changed, 1911 insertions(+), 642 deletions(-)

Appreciations:

Important:

  • libmdbx project has changed its code development and distribution model.
    To get acquainted with important changes and plans, we recommend reading the compact presentation "libmdbx: successes, obstacles, goals and roadmap", which contains important explanations in the form of embedded comments.

  • At a many requests of users, the change log and the release notes now is kept in English.

Fixes:

  • Fixed using of the identifier ERROR_UNHANDLED_ERROR, which is not defined in new versions of Windows SDK.

  • Fixed non-closing of DBI descriptors for tables created in nested transactions when such transactions are aborted.

  • Fixed MSVC warning C4324 for buffer::silo::bin.

  • Added workaround for MinGW build failures of dll-enabled C++ API.

  • Fixed extra msync/fsync operations during GC reclaiming in a full database.

  • Fixed suboptimal reducing/merging of histogram items in an output of mdbx_chk tool.

  • Added backlog-adjustment trick to avoid extra-growth of DB instead of reclaim GC in a rare specific cases.
    In the 0.14.x version series, this mechanism has been completely updated.
    However, for version 0.13.11, this inelegant modification done in order to reduce the risk of regression.

  • Minor fixed iov_callback4dirtypages() and assertion inside cursor_put() to avoid Valgrind/ASAN warnings.

  • Fixed cursor(s) finalization after ones explicitly closed in a nested transactions.

Other:

  • Clarification and addition of documentation.

  • Considering extended ASCII as non-printable if UTF8 enabled in C++ API.

  • Using hex dump of mdbx::slice instead of base58 in C++ API.

  • Added link to mdbxmou bindings for NodeJS.

Downloads:


For more information please see ChangeLog in the stable branch.

v0.13.10 "Gloss of Glory" (Блеск Славы)

Choose a tag to compare

@erthink erthink released this 21 Dec 19:04
Immutable release. Only release title and notes can be modified.
v0.13.10_github_workaround

The supporting release of a stable branch with bug fixes, in memory of Michael Alexander Gloss, American, son of Deputy Director of the CIA, who died heroically in search of justice for the bright ideals of humanity and was posthumously awarded the Order of Courage.

For more information please see ChangeLog in the stable branch.

Downloads:


We relocated to SourceCraft.dev

The libmdbx project has been completely relocated to the jurisdiction of the Russian Federation.

Please refer to https://libmdbx.dqdkfa.ru for documentation and https://sourcecraft.dev/dqdkfa/libmdbx for the source code (it is still open and provided with first-class free support).

Regardless of anything else, We would like to thank Erigon once again for the sponsorship.