Commit Graph

327 Commits

Author SHA1 Message Date
gcxfd
45a11f3dc2 mdbx: Make the documentation of MDBX_INTEGERKEY clearer.
Resolves https://github.com/erthink/libmdbx/pull/249.
2021-12-03 22:29:28 +03:00
Leonid Yuriev
f355f247c3 mdbx: add inlined mdbx_env_get_syncbytes() & mdbx_env_get_syncperiod(). 2021-12-03 21:55:40 +03:00
Leonid Yuriev
e912f87b2a mdbx: clarify notes about custom comparators usage. 2021-11-26 23:49:38 +03:00
Leonid Yuriev
085a97f835 mdbx: define MDBX_ENODATA == 9919 on systems without ENODATA.
As workaround for incompatibility C and C++ code using LLVM's C++ libraries/headers on on systems without native `ENODATA`.
2021-11-22 16:09:08 +03:00
Leonid Yuriev
773172cc99 mdbx: minor clarify descriptions of the MDBX_commit_latency fields. 2021-11-19 18:36:14 +03:00
Leonid Yuriev
ff26d30362 mdbx: minor clarity enum MDBX_db_flags_t (database flags) descriptions.
Related to https://github.com/erthink/libmdbx/issues/241
2021-11-12 19:38:48 +03:00
Leonid Yuriev
8870d33fcd mdbx++: refine MDBX_CXX01_CONSTEXPR for legacy compilers.
Enable `constexpr` via `MDBX_CXX01_CONSTEXPR` if __cplusplus == 201103L but __cpp_constexpr is undefined.
2021-11-07 02:18:56 +03:00
Leonid Yuriev
fcb8cd2145
mdbx: alter DB-format' signature and change version to v0.11.x (not a release).
Related to https://github.com/erthink/libmdbx/issues/238

Signed-off-by: Leonid Yuriev <leo@yuriev.ru>
2021-10-21 15:17:18 +03:00
Leonid Yuriev
e3300259ff mdbx: add minor enum-related workarounds for UndefinedBeheviorSanitizer. 2021-08-14 16:43:16 +03:00
Leonid Yuriev
68273acc2a mdbx: add and use MDBX_NOSANITIZE_ENUM macro. 2021-08-14 16:43:12 +03:00
Leonid Yuriev
4bb0c57e29 mdbx: minor fixes/workarounds for CLANG < 9.x 2021-08-04 15:43:32 +03:00
Leonid Yuriev
79281d59c7 mdbx++: workaround macro for clang bugs. 2021-07-26 03:53:11 +03:00
Leonid Yuriev
046dc02f73 mdbx: make MDBX_STRINGIFYmacro public. 2021-07-26 03:53:11 +03:00
Leonid Yuriev
faafa21480 mdbx-doc: refine Dixygen comments related to use custom comparators. 2021-07-21 02:23:10 +03:00
Leonid Yuriev
c5268f1da7 mdbx-tools: add support of page operations stat to mdbx_stat. 2021-05-12 14:41:09 +03:00
Leonid Yuriev
23e11e3a57 mdbx: refine/fix MDBX_MAYBE_UNUSED for modern GCC 11.x and C20. 2021-05-12 14:40:58 +03:00
Leonid Yuriev
ebab75642e mdbx: add public MDBX_MAYBE_UNUSED.
This also should fix C++ mdbx API build by MSVC 2015.
2021-05-11 21:07:40 +03:00
Леонид Юрьев (Leonid Yuriev)
aa1f6fbd5f
mdbx: release v0.10.0
Acknowledgements:
-----------------
 - [Mahlon E. Smith](https://github.com/mahlonsmith) for [Ruby bindings](https://rubygems.org/gems/mdbx/).
 - [Alex Sharov](https://github.com/AskAlexSharov) for [mdbx-go](https://github.com/torquem-ch/mdbx-go), bug reporting and testing.
 - [Artem Vorotnikov](https://github.com/vorot93) for bug reporting and PR.
 - [Paolo Rebuffo](https://www.linkedin.com/in/paolo-rebuffo-8255766/), [Alexey Akhunov](https://github.com/AlexeyAkhunov) and Mark Grosberg for donations.
 - [Noel Kuntze](https://github.com/Thermi) for preliminary [Python bindings](https://github.com/Thermi/libmdbx/tree/python-bindings)

New features:
-------------
 - Added `mdbx_env_set_option()` and `mdbx_env_get_option()` for controls
   various runtime options for an environment (announce of this feature  was missed in a previous news).
 - Added `MDBX_DISABLE_PAGECHECKS` build option to disable some checks to reduce an overhead
   and detection probability of database corruption to a values closer to the LMDB.
   The `MDBX_DISABLE_PAGECHECKS=1` provides a performance boost of about 10% in CRUD scenarios,
   and conjointly with the `MDBX_ENV_CHECKPID=0` and `MDBX_TXN_CHECKOWNER=0` options can yield
   up to 30% more performance compared to LMDB.
 - Using float point (exponential quantized) representation for internal 16-bit values
   of grow step and shrink threshold when huge ones (https://github.com/erthink/libmdbx/issues/166).
   To minimize the impact on compatibility, only the odd values inside the upper half
   of the range (i.e. 32769..65533) are used for the new representation.
 - Added the `mdbx_drop` similar to LMDB command-line tool to purge or delete (sub)database(s).
 - [Ruby bindings](https://rubygems.org/gems/mdbx/) is available now by [Mahlon E. Smith](https://github.com/mahlonsmith).
 - Added `MDBX_ENABLE_MADVISE` build option which controls the use of POSIX `madvise()` hints and friends.
 - The internal node sizes were refined, resulting in a reduction in large/overflow pages in some use cases
   and a slight increase in limits for a keys size to ≈½ of page size.
 - Added to `mdbx_chk` output number of keys/items on pages.
 - Added explicit `install-strip` and `install-no-strip` targets to the `Makefile` (https://github.com/erthink/libmdbx/pull/180).
 - Major rework page splitting (af9b7b5605) for
     - An "auto-appending" feature upon insertion for both ascending and
       descending key sequences. As a result, the optimality of page filling
       increases significantly (more densely, less slackness) while
       inserting ordered sequences of keys,
     - A "splitting at middle" to make page tree more balanced on average.
 - Added `mdbx_get_sysraminfo()` to the API.
 - Added guessing a reasonable maximum DB size for the default upper limit of geometry (https://github.com/erthink/libmdbx/issues/183).
 - Major rework internal labeling of a dirty pages (958fd5b947) for
   a "transparent spilling" feature with the gist to make a dirty pages
   be ready to spilling (writing to a disk) without further altering ones.
   Thus in the `MDBX_WRITEMAP` mode the OS kernel able to oust dirty pages
   to DB file without further penalty during transaction commit.
   As a result, page swapping and I/O could be significantly reduced during extra large transactions and/or lack of memory.
 - Minimized reading leaf-pages during dropping subDB(s) and nested trees.
 - Major rework a spilling of dirty pages to support [LRU](https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU))
   policy and prioritization for a large/overflow pages.
 - Statistics of page operations (split, merge, copy, spill, etc) now available through `mdbx_env_info_ex()`.
 - Auto-setup limit for length of dirty pages list (`MDBX_opt_txn_dp_limit` option).
 - Support `make options` to list available build options.
 - Support `make help` to list available make targets.
 - Silently `make`'s build by default.
 - Preliminary [Python bindings](https://github.com/Thermi/libmdbx/tree/python-bindings) is available now
   by [Noel Kuntze](https://github.com/Thermi) (https://github.com/erthink/libmdbx/issues/147).

Backward compatibility break:
-----------------------------
 - The `MDBX_AVOID_CRT` build option was renamed to `MDBX_WITHOUT_MSVC_CRT`.
   This option is only relevant when building for Windows.
 - The `mdbx_env_stat()` always, and `mdbx_env_stat_ex()` when called with the zeroed transaction parameter,
   now internally start temporary read transaction and thus may returns `MDBX_BAD_RSLOT` error.
   So, just never use deprecated `mdbx_env_stat()' and call `mdbx_env_stat_ex()` with transaction parameter.
 - The build option `MDBX_CONFIG_MANUAL_TLS_CALLBACK` was removed and now just a non-zero value of
   the `MDBX_MANUAL_MODULE_HANDLER` macro indicates the requirement to manually call `mdbx_module_handler()`
   when loading libraries and applications uses statically linked libmdbx on an obsolete Windows versions.

Fixes:
------
 - Fixed performance regression due non-optimal C11 atomics usage (https://github.com/erthink/libmdbx/issues/160).
 - Fixed "reincarnation" of subDB after it deletion (https://github.com/erthink/libmdbx/issues/168).
 - Fixed (disallowing) implicit subDB deletion via operations on `@MAIN`'s DBI-handle.
 - Fixed a crash of `mdbx_env_info_ex()` in case of a call for a non-open environment (https://github.com/erthink/libmdbx/issues/171).
 - Fixed the selecting/adjustment values inside `mdbx_env_set_geometry()` for implicit out-of-range cases (https://github.com/erthink/libmdbx/issues/170).
 - Fixed `mdbx_env_set_option()` for set initial and limit size of dirty page list ((https://github.com/erthink/libmdbx/issues/179).
 - Fixed an unreasonably huge default upper limit for DB geometry (https://github.com/erthink/libmdbx/issues/183).
 - Fixed `constexpr` specifier for the `slice::invalid()`.
 - Fixed (no)readahead auto-handling (https://github.com/erthink/libmdbx/issues/164).
 - Fixed non-alloy build for Windows.
 - Switched to using Heap-functions instead of LocalAlloc/LocalFree on Windows.
 - Fixed `mdbx_env_stat_ex()` to returning statistics of the whole environment instead of MainDB only (https://github.com/erthink/libmdbx/issues/190).
 - Fixed building by GCC 4.8.5 (added workaround for a preprocessor's bug).
 - Fixed building C++ part for iOS <= 13.0 (unavailability of  `std::filesystem::path`).
 - Fixed building for Windows target versions prior to Windows Vista (`WIN32_WINNT < 0x0600`).
 - Fixed building by MinGW for Windows (https://github.com/erthink/libmdbx/issues/155).

TODO for a next releases:
-------------------------
 - [Get rid of dirty-pages list in MDBX_WRITEMAP mode](https://github.com/erthink/libmdbx/issues/193).
 - [Large/Overflow pages accounting for dirty-room](https://github.com/erthink/libmdbx/issues/192).
 - [C++ Buffer issue](https://github.com/erthink/libmdbx/issues/191).
 - Finalize C++ API (few typos and trivia bugs are still likely for now).
 - [Support for RAW devices](https://github.com/erthink/libmdbx/issues/124).
 - [Test framework issue](https://github.com/erthink/libmdbx/issues/127).
 - [Support MessagePack for Keys & Values](https://github.com/erthink/libmdbx/issues/115).
 - [Engage new terminology](https://github.com/erthink/libmdbx/issues/137).
 - Packages for [Astra Linux](https://astralinux.ru/), [ALT Linux](https://www.altlinux.org/), [ROSA Linux](https://www.rosalinux.ru/), Fedora/RHEL, Debian/Ubuntu.
2021-05-09 03:01:59 +03:00
Leonid Yuriev
ecd3c06932 mdbx-windows: remove MDBX_CONFIG_MANUAL_TLS_CALLBACK build option and add MDBX_MANUAL_MODULE_HANDLER macro.
Briefly:
 - Now constructor/destructor of "Thread Local Storage" handled automatically when possible.
 - Otherwise the MDBX_CONFIG_MANUAL_TLS_CALLBACK macro defined to 1 to indicate that mdbx_module_handle() should be called manually.
 - Corresponding build option MDBX_CONFIG_MANUAL_TLS_CALLBACK was removed.

Related to https://github.com/erthink/libmdbx/issues/155

Change-Id: Ic4e6a34b44f874676f0ab212ff473460e3d80559
2021-05-08 18:39:18 +03:00
Leonid Yuriev
33e8b19ea4 mdbx-windows: check _WIN32_WINNT definition.
Related to https://github.com/erthink/libmdbx/issues/155

Change-Id: I49c294bd0fa055026b742a12a6f6ea9cd805cf02
2021-05-08 18:38:36 +03:00
Leonid Yuriev
1275bdb623 mdbx: add MDBX_opt_merge_threshold_16dot16_percent option.
Change-Id: I416f85096e4b6fd21f2db622f07f31103cb9074a
2021-05-06 02:05:33 +03:00
Leonid Yuriev
c914d417d2 mdbx: refine Doxygen's API description.
Change-Id: Ifd326eded287c68c6a95b6c9be22847d6efa5678
2021-05-03 15:00:53 +03:00
Leonid Yuriev
f95a277ac5 mdbx: statistics of page operations.
Related to https://github.com/erthink/libmdbx/issues/186

Change-Id: Ia00e6e0df9a65f880517ca33e7f444a0526b96e1
2021-04-27 18:02:11 +03:00
Leonid Yuriev
024ccf6826 mdbx: extract mdbx_get_sysraminfo().
Change-Id: I8821009572d275a3b5d2d8729f605b115a80e50a
2021-04-07 04:45:53 +03:00
Leonid Yuriev
8d3b878965 mdbx: fix minor spelling.
Change-Id: Ibab66dc18c92b0ac4fa705e10befb34e268ee1f7
2021-03-28 22:25:17 +03:00
Leonid Yuriev
f2d2a4c698 mdbx-doc: minor fix typo / wrong reference to mdbx_cursor_set().
Change-Id: I22216ffc2ad2d7545d87969df4284239f8caecb5
2021-03-14 16:31:38 +03:00
Leonid Yuriev
8133d93678 mdbx: add LIBMDBX_NO_EXPORTS_LEGACY_API build option.
Change-Id: I9d9dcffe63fce843e22132c3829adca57714d818
2021-02-02 00:25:48 +03:00
Leonid Yuriev
f698f07ff9 mdbx: fix operation for unusual small/large system page size.
More for https://github.com/erthink/libmdbx/issues/157

Change-Id: I4f2ed54b50653d0375538b82c48590d1037cd93b
2021-01-29 21:19:58 +03:00
Leonid Yuriev
86db3670aa mdbx-doc: use multiple Doxygen's groups for cursor functions (haven't effect with current Doxygen).
Change-Id: I00263bfd19588e83410f449886b7eefce4bcf0e1
2021-01-26 22:19:14 +03:00
Leonid Yuriev
7ae5ddefe5 mdbx-doc: fix typo and add refs to c_crud_hints anchor.
Change-Id: I46b26ee6f9ca4e1f06c573b61a42d8fbedefd836
2021-01-26 22:18:28 +03:00
Leonid Yuriev
251eda6fb8 mdbx: HNY!
Change-Id: I86c7028001b349e3d06b837dc8e2f7e60fb3b1a2
2021-01-26 07:27:13 +03:00
Leonid Yuriev
4e13d1239a mdbx: 'runtime options' feature release.
Resolve https://github.com/erthink/libmdbx/issues/128

Change-Id: I67411f623ecb917d3be1cdc6aa78b879d8e68b4c
2021-01-23 01:13:20 +03:00
Leonid Yuriev
4ae2a107bf mdbx: add MDBX_opt_loose_limit runtime option.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: I298bf1eef24575df72615ee07e93f5073405e8e0
2021-01-22 23:52:03 +03:00
Leonid Yuriev
dc34041600 mdbx: alter defaults for MDBX_opt_rp_augment_limit and MDBX_opt_txn_dp_limit runtime options.
Change-Id: I08cdbfb18089a3fed4b32d931ca4423027a9939f
2021-01-22 23:16:21 +03:00
Leonid Yuriev
b82d1d5063 mdbx: add MDBX_opt_spill_parent4child_denominator runtime option.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: If1549c3855eb59c107eb115e6dbca515e81644f9
2021-01-22 18:18:52 +03:00
Leonid Yuriev
56aaad03bc mdbx: add MDBX_opt_spill_max_denominator and MDBX_opt_spill_min_denominator runtime options.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: I6b1b00e30ac11e9c2e3d3d3a29cc73079b41d539
2021-01-22 17:25:44 +03:00
Leonid Yuriev
a906569c58 mdbx: merge branch 'master' into devel-rebase.
Change-Id: I96d944f283029b9c60e45683ee66b4564273b407
2021-01-19 23:51:52 +03:00
byronhe
3a441d6d3a Update mdbx.h 2021-01-04 17:49:25 +03:00
Leonid Yuriev
082df3a573 mdbx: refine MDBX_opt_* descriptions and defaults.
Change-Id: I99ddf530d5683b755bc8bab1ea1098b0cc00b181
2020-12-17 22:03:14 +03:00
Leonid Yuriev
76716c23b0 mdbx: add MDBX_opt_txn_dp_initial & MDBX_opt_txn_dp_limit.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: I4be3c7476e9ce16ed4f27691d0df653552930e3c
2020-12-03 17:17:30 +03:00
Leonid Yuriev
4cd08f0ef9 mdbx: add MDBX_opt_rp_augment_limit.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: I94f3350b72ad11d0b586aaef1574f7654223bc40
2020-12-02 20:07:55 +03:00
Leonid Yuriev
461ba000e3 mdbx: add MDBX_opt_dp_reserve_limit.
More for https://github.com/erthink/libmdbx/issues/128

Change-Id: I620b6dcd833fcff19680770974f32431ab91c0ab
2020-12-02 12:42:16 +03:00
Leonid Yuriev
8f60050991 mdbx: initial support for set/get_options.
Initial for https://github.com/erthink/libmdbx/issues/128

Change-Id: I540784c8b54d7443748e3c95f89a7390b818c811
2020-12-02 12:42:13 +03:00
Leonid Yuriev
3d41abd318 mdbx: use unsigned for DEFINE_ENUM_FLAG_OPERATORS to be more consistent with C/C++standards.
Change-Id: Iadbd59694606b577602f8e86ec371c3599639b19
2020-11-29 05:49:20 +03:00
Leonid Yuriev
8381ed1d2e mdbx: minor fix comment copy&paste typo.
Change-Id: I34d4eaebdcf7a4e3bda7f0834e6e14d17e26f7db
2020-11-29 05:49:20 +03:00
Leonid Yuriev
28a275cba2 mdbx: minor refine MDBX_CXX#_CONSTEXPR macros for Doxygen.
Change-Id: I35d8cb6badacdee089e2382b34524e108423acfc
2020-11-29 05:49:20 +03:00
Leonid Yuriev
659fbb3df7 mdbx-doc: fix MDBX_INTEGERDUP description.
Resolve https://github.com/erthink/libmdbx/issues/140

Change-Id: Ifb24cbbc9cba7d0c09da8e99e6d87412d151d093
2020-11-24 07:50:52 +03:00
Leonid Yuriev
94fae97f88 mdbx: avoid paranoid CLANG's enum ops UB. 2020-11-17 15:00:51 +03:00
Leonid Yuriev
5e02e7fb56 mdbx: add MDBX_SET_LOWERBOUND for mdbx_cursor_get().
Change-Id: I3638fdd10be8dfe128c43b465e9ca71f89175b3e
2020-11-17 08:13:46 +03:00
Leonid Yuriev
b6f0070f85 mdbx: add mdbx_cursor_copy().
Change-Id: I476f1230beec6a550897bef236745530154c1079
2020-11-16 07:07:38 +03:00