472 Commits

Author SHA1 Message Date
Леонид Юрьев (Leonid Yuriev)
98e29fe628 mdbx-windows: UNICODE-зависимое определение макросов MDBX_DATANAME, MDBX_LOCKNAME и MDBX_LOCK_SUFFIX. 2022-10-10 13:56:57 +03:00
Леонид Юрьев (Leonid Yuriev)
66f2e3d596 mdbx: добавление в API функций mdbx_limits_pairsize4page_max() и mdbx_limits_valsize4page_max() с сопутствующими доработками. 2022-10-10 13:56:57 +03:00
Леонид Юрьев (Leonid Yuriev)
bcd5bad74a mdbx: добавлено MDBX_NORETURN к mdbx_panic() и mdbx_assert_fail(). 2022-10-10 13:56:57 +03:00
Леонид Юрьев (Leonid Yuriev)
474391c83c mdbx: поддержка асинхронного ввода-вывода для Windows и подготовка к io_ring (объединённые коммиты и исправления). 2022-10-06 20:35:07 +03:00
Леонид Юрьев (Leonid Yuriev)
29da09328e mdbx: removed description of deprecated usage of MDBX_NODUPDATA. 2022-09-06 13:03:04 +03:00
Леонид Юрьев (Leonid Yuriev)
f9ad835680 mdbx: drop E2K libc obsolete workarounds. 2022-08-17 21:29:51 +03:00
Леонид Юрьев (Leonid Yuriev)
9b3faee630 mdbx: drop obsolete Nexenta attributes API. 2022-08-17 21:29:51 +03:00
Леонид Юрьев (Leonid Yuriev)
2ff8d3c4f2 mdbx: native wchar_t pathname for Windows. 2022-08-09 18:27:43 +03:00
Леонид Юрьев (Leonid Yuriev)
12d2879a9f mdbx: extend descriptions for MDBX_VALIDATION and update TODO for done item. 2022-07-09 19:40:09 +03:00
Леонид Юрьев (Leonid Yuriev)
9aa2aae93e mdbx: rework/simplify kick_longlived_readers(). 2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
2cfcfcf91c mdbx: merge branch erigon into devel. 2022-07-07 23:24:45 +03:00
Леонид Юрьев (Leonid Yuriev)
d4ef9bf233 mdbx: rework page validation/checking, add MDBX_VALIDATION option (squashed).
Здесь основная часть изменений преобразующих отладочную проверку страниц
в регулярный и доступный пользователю осторожный/безопасный режим работы
с потенциально поврежденной БД.

Here the major part of the changes that transform a debugging check of
pages into a regular and user-accessible careful/safe mode for working
with a potentially corrupted database.
2022-07-07 14:10:09 +03:00
Леонид Юрьев (Leonid Yuriev)
4f6b92248d mdbx: add pgop_stat.gcrtime for collect the time spent loading and searching inside GC. 2022-07-01 09:27:38 +03:00
Леонид Юрьев (Leonid Yuriev)
46f61c3006 mdbx: merge branch master into devel. 2022-06-27 12:39:09 +03:00
Леонид Юрьев (Leonid Yuriev)
e3a09db3da mdbx: always coalescing GC records, regardless to MDBX_COALESCE flag. 2022-06-27 12:37:29 +03:00
Леонид Юрьев (Leonid Yuriev)
7b735c272d mdbx: allow predefine/customise MDBX_LOCK_SUFFIX, MDBX_DATANAME, MDBX_LOCKNAME. 2022-06-25 22:14:06 +03:00
Леонид Юрьев (Leonid Yuriev)
5d933d09d3 mdbx: minor refine/clarify descriptions of MDBX_LOCKNAME and MDBX_DATANAME. 2022-06-25 15:27:33 +03:00
Леонид Юрьев (Leonid Yuriev)
f5280ebf6e mdbx: bump version to 0.12.0 (not a release but preparation for changing feature set and API). 2022-06-25 15:14:46 +03:00
Леонид Юрьев (Leonid Yuriev)
b6138c39f0 mdbx: reorganize internal includes. 2022-06-02 20:35:40 +03:00
Леонид Юрьев (Leonid Yuriev)
106f39327e mdbx: add mdbx_assert_fail() to public API. 2022-06-02 20:35:40 +03:00
Леонид Юрьев (Leonid Yuriev)
70d9efdce4 mdbx: fix minor CLANG 14/15 warnings. 2022-05-17 13:36:38 +03:00
Леонид Юрьев (Leonid Yuriev)
9230201ca9 mdbx: fix minor warning for MDBX_TXN_INVALID. 2022-05-03 14:16:19 +03:00
Леонид Юрьев (Leonid Yuriev)
838f8d8fab mdbx: move most of transactions flags to public API. 2022-05-03 11:49:28 +03:00
Леонид Юрьев (Leonid Yuriev)
1b0519a94a mdbx-docs: fix Doxygen groups for struct MDBX_commit_latency and mdbx_txn_commit_ex(). 2022-05-03 11:49:28 +03:00
Леонид Юрьев (Leonid Yuriev)
ce229c7500 mdbx-docs: more refine/clarify Doxygen descriptions. 2022-04-23 23:23:15 +03:00
Леонид Юрьев (Leonid Yuriev)
9c569b41ed mdbx-docs: fix/refine C++ API docs by Doxygen. 2022-04-23 23:23:15 +03:00
Леонид Юрьев (Leonid Yuriev)
2921711638 mdbx: minor refine note about migration from dead github. 2022-04-21 15:34:56 +03:00
Леонид Юрьев (Leonid Yuriev)
35b5abc103 mdbx: minor fix/refix Doxygen descriptions. 2022-04-20 18:04:04 +03:00
Леонид Юрьев (Leonid Yuriev)
8fb63c3675 mdbx: minor refine API descriptions. 2022-04-13 11:05:03 +03:00
Леонид Юрьев (Leonid Yuriev)
cabead30b5 mdbx: minor cosmetics. 2022-03-31 00:31:49 +03:00
Леонид Юрьев (Leonid Yuriev)
6f37c8e57f mdbx: resolve all warnings from MinGW. 2022-03-30 18:13:08 +03:00
Леонид Юрьев (Leonid Yuriev)
33a9395afe mdbx: use MDBX_EPERM to indicate that the geometry cannot be updated instead of `MDBX_RESULT_TRUE'. 2022-03-29 18:57:26 +03:00
Леонид Юрьев (Leonid Yuriev)
de63041b7d mdbx: add MDBX_DBG_DONT_UPGRADE flag. 2022-03-23 00:48:41 +03:00
Леонид Юрьев (Leonid Yuriev)
77f236db2a mdbx: clarify loglevel descriptions. 2022-02-17 02:30:16 +03:00
Леонид Юрьев (Leonid Yuriev)
cbbfaf3202 mdbx-doc: fix doxygen-reference to the "Long-lived read transactions" paragraph. 2022-02-08 14:37:11 +03:00
Леонид Юрьев (Leonid Yuriev)
d498c2580b mdbx: more refine mdbx_env_set_geometry() description. 2022-02-02 14:28:45 +03:00
Леонид Юрьев (Leonid Yuriev)
e740df6e50 mdbx: fix description of mdbx_env_set_geometry().
Oops, I just noticed that there are a strange typos in the description.
It looks like a search&replace or cut&paste mistake.

Related to https://github.com/LWJGL/lwjgl3/issues/724.
2022-02-02 14:09:03 +03:00
Leonid Yuriev
8adf242d02 mdbx-doc: more line-breaks for Doxygen. 2022-01-25 20:25:10 +03:00
Leonid Yuriev
28fcf33cda mdbx-doc: fix/refine MDBX_dbi description. 2022-01-25 20:09:17 +03:00
Leonid Yuriev
86d4e37327 mdbx: fix minor copy-paste errors in descriptions. 2022-01-25 01:08:14 +03:00
Leonid Yuriev
75b23524bd mdbx-doc: minor refine mdbx_env_set_geometry() description. 2022-01-21 11:44:05 +03:00
Leonid Yuriev
c588af6aca mdbx: update Copyright year.
Change-Id: Ib3e4c0ac94882c4b2a1e167dd98e6e26dbdf48a4
2022-01-17 11:06:14 +03:00
Leonid Yuriev
406cafb642 mdbx: treat the UINT64_MAX value as maximum for given option inside mdbx_env_set_option(). 2022-01-06 00:37:08 +03:00
Leonid Yuriev
4e44dc69f9 mdbx: add MDBX_SET_UPPERBOUND for cursors.
Resolves https://github.com/erthink/libmdbx/issues/250.
2021-12-13 04:24:34 +03:00
Leonid Yuriev
6f2c1e52ad mdbx: add mdbx_cursor_get_batch().
Resolve https://github.com/erthink/libmdbx/issues/236
2021-12-11 05:58:39 +03:00
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 (af9b7b560505684249b76730997f9e00614b8113) 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 (958fd5b9479f52f2124ab7e83c6b18b04b0e7dda) 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
Leonid Yuriev
1f6e325d71 mdbx-doc: refine Doxygen configuration.
Change-Id: I8fbcb30f18ff9f8efafbf97c22a1dfbebe7e0926
2020-10-31 02:55:22 +03:00
Leonid Yuriev
b1d21d571f mdbx: minor refine/fix MDBX_SAFE_NOSYNC description.
Change-Id: I26c6f56363b9ec89dd321961133784b410cea1e0
2020-10-27 20:02:17 +03:00
Leonid Yuriev
e1d9ac8b29 mdbx: merge branch 'devel'.
Change-Id: I75e7f183fba291faa7e380e7c95c3a7bb44fe6ac
2020-10-27 20:02:00 +03:00
Leonid Yuriev
31857210c5 mdbx: minor reformat doxygen comments.
Change-Id: I0dbe6ddc1423a1fdcb2eb73b2e982e398de1faa7
2020-10-26 00:42:21 +03:00
Alex Sharov
97b47dea87
mdbx-docs: refine docs for geo.shrink_threshold (#125) 2020-10-22 14:12:04 +03:00
Leonid Yuriev
b964b2abf5 mdbx: more spelling.
Change-Id: I45e42c1d8ef51f910b8e41279b92e54a6b2ce772
2020-10-21 01:00:48 +03:00
Leonid Yuriev
f73a8a8680 mdbx: add latency gathering for commit stages.
Change-Id: If68ceb6e69e5e565ce9de0fd9a80424b6da280c5
2020-10-21 01:00:48 +03:00
Leonid Yuriev
7cf92b66cf mdbx: add LIBMDBX_INLINE_API (both inline and non-inline of some API functions).
Change-Id: I00c2b6d3d2a0467080791ea0c1c2242742a20c78
2020-10-17 01:00:36 +03:00
Leonid Yuriev
de1856a73c mdbx: workaround for broken DEFINE_ENUM_FLAG_OPERATORS from Windows SDK.
Change-Id: I5335c72061b7c5b6b29c683061a5da95544b9753
2020-10-10 23:53:35 +03:00
Leonid Yuriev
6e82dd5d0c mdbx: minor refine description of mdbx_env_delete().
Change-Id: I095c741fba08b08c6302116d9601438d813524a1
2020-10-10 18:30:21 +03:00
Leonid Yuriev
0627d902dd mdbx: add mdbx_env_delete().
Resolves https://github.com/erthink/libmdbx/issues/119
Related to https://github.com/Kerollmops/heed/issues/58

Change-Id: Iec5bf5978e45bb6843f3ed8dd06ea4d34f2895cb
2020-10-10 00:58:53 +03:00
Leonid Yuriev
c4e3b95301 mdbx: clarify the mdbx_env_open()'s pathname parameter description.
Change-Id: I1afafe621b2047abe4af02d37d51142a94abb982
2020-10-10 00:52:41 +03:00
Leonid Yuriev
44b1a3bcff
mdbx: release v0.9.1
Added features:

 - Preliminary C++ API with support for C++17 polymorphic allocators.
 - [Online C++ API reference](https://erthink.github.io/libmdbx/) by Doxygen.
 - Quick reference for Insert/Update/Delete operations.
 - Explicit `MDBX_SYNC_DURABLE` to sync modes for API clarity.
 - Explicit `MDBX_ALLDUPS` and `MDBX_UPSERT` for API clarity.
 - Support for read transactions preparation (`MDBX_TXN_RDONLY_PREPARE` flag).
 - Support for cursor preparation/(pre)allocation and reusing (`mdbx_cursor_create()` and `mdbx_cursor_bind()` functions).
 - Support for checking database using specified meta-page (see `mdbx_chk -h`).
 - Support for turn to the specific meta-page after checking (see `mdbx_chk -h`).
 - Support for explicit reader threads (de)registration.
 - The `mdbx_txn_break()` function to explicitly mark a transaction as broken.
 - Improved handling of corrupted databases by `mdbx_chk` utility and `mdbx_walk_tree()` function.
 - Improved DB corruption detection by checking parent-page-txnid.
 - Improved opening large DB (> 4Gb) from 32-bit code.
 - Provided `pure-function` and `const-function` attributes to C API.
 - Support for user-settable context for transactions & cursors.
 - Revised API and documentation related to Handle-Slow-Readers callback feature.

Deprecated functions and flags:

 - For clarity and API simplification the `MDBX_MAPASYNC` flag is deprecated.
   Just use `MDBX_SAFE_NOSYNC` or `MDBX_UTTERLY_NOSYNC` instead of it.
 - `MDBX_oom_func`, `mdbx_env_set_oomfunc()` and `mdbx_env_get_oomfunc()`
   replaced with `MDBX_hsr_func`, `mdbx_env_get_hsr` and `mdbx_env_get_hsr()`.

Fixes:

 - Fix `mdbx_strerror()` for `MDBX_BUSY` error (no error description is returned).
 - Fix update internal meta-geo information in read-only mode (`EACCESS` or `EBADFD` error).
 - Fix `mdbx_page_get()` null-defer when DB corrupted (crash by `SIGSEGV`).
 - Fix `mdbx_env_open()` for re-opening after non-fatal errors (`mdbx_chk` unexpected failures).
 - Workaround for MSVC 19.27 `static_assert()` bug.
 - Doxygen descriptions and refinement.
 - Update Valgrind's suppressions.
 - Workaround to avoid infinite loop of 'nested' testcase on MIPS under QEMU.
 - Fix a lot of typos & spelling (Thanks to Josh Soref for PR).
 - Fix `getopt()` messages for Windows (Thanks to Andrey Sporaw for reporting).
 - Fix MSVC compiler version requirements (Thanks to Andrey Sporaw for reporting).
 - Workarounds for QEMU's bugs to run tests for cross-builded library under QEMU.
 - Now C++ compiler optional for building by CMake.

TODO for next version(s):

 - Rework/speedup the implementation of the dirty page list (lazy compactification, lazy sorting via merge).
 - Finalize C++ API (few typos and trivia bugs are likely for now).
 - Packages for ROSA Linux, ALT Linux, Fedora/RHEL, Debian/Ubuntu.

Change-Id: I668d77e4545d444b60708b8c64a66ce43b2c56a0
2020-09-30 13:28:01 +03:00
Leonid Yuriev
f6850f5367 mdbx: Support for user-settable cursor context.
Change-Id: I9bd60c432924e39020b2d3af3280f13c44d6cd91
2020-09-29 21:15:25 +03:00
Leonid Yuriev
72e136b9da mdbx-doc: fix/refine README & Doxygen docs.
Change-Id: I79cfb44f84fbf0f118b0d209af1ef62bb9dae72a
2020-09-29 21:15:25 +03:00
Leonid Yuriev
c8a0951566 mdbx: rework API and Docs around Handle-Slow-Readers (no algorithmic changes).
Change-Id: I5b76a8400ce6f5f241f8e4a7f53d746fe39f8e1e
2020-09-29 21:15:25 +03:00
Leonid Yuriev
6294e1710a mdbx: support for user-settable transaction context.
Change-Id: Ib4a345628e2c1ca2f95ac7615ea53d94911e5198
2020-09-29 20:59:55 +03:00
Leonid Yuriev
5627521f16 mdbx++: more spelling.
Change-Id: I3f33e695fb918c6a57c39047bba54a72ecb9bc5b
2020-09-27 17:01:59 +03:00
Leonid Yuriev
12339d4e7c mdbx: rename bootid' fields to be neutral for endianess.
Change-Id: I7d52d3c2c93dcc6e886d336885070eb1aee1c284
2020-09-26 02:23:09 +03:00
Leonid Yuriev
860aa017db mdbx: Merge branch 'master' into devel.
Change-Id: Ic130cd181097332aa2f49019d75403e18d8cba0d
2020-09-25 01:14:57 +03:00
Josh Soref
448728f584 mdbx: a lot of spelling (squashed).
Many Thanks to Josh Soref for these fixes.
https://github.com/jsoref

Resolves https://github.com/erthink/libmdbx/pull/118.

Change-Id: I4e09347da5c9d7a77cdd918a3b15284371440076
2020-09-25 01:01:25 +03:00
Leonid Yuriev
58708f7162 mdbx: add mdbx_env_turn_for_recovery().
Change-Id: Ic02a5adf9ad398ae5b499e8808157e41ec42457e
2020-09-23 10:05:38 +03:00
Leonid Yuriev
d9daf2944d mdbx: add env_open_for_recovery() (squashed).
Change-Id: I0151b21610def433745c33d1f6e0b66ce655d1a9
2020-09-19 01:48:24 +03:00
Leonid Yuriev
10b170c6cd mdbx: add mdbx_cursor_create() and mdbx_cursor_bind().
Change-Id: I223de3cca7865d58f17a59ab27ec6be730e04a90
2020-09-15 02:05:25 +03:00
Leonid Yuriev
234d65dc9d mdbx++: update copyright & license note.
Change-Id: If6aac3dec6d05247aec5af956385066619685c35
2020-09-14 21:19:56 +03:00
Leonid Yuriev
cacc4aa829 mdbx++: changes after codereview-1 (part 2 of 2).
Change-Id: I8e1ca134bb8c5d447895f116247dfd12fa6871f0
2020-09-14 21:19:56 +03:00
Leonid Yuriev
17d9ed31f9 mdbx: support for building by GCC 4.8
Change-Id: I4ad5c5be60233ae68936e0cbca1a0f01ec786bad
2020-09-13 21:22:41 +03:00
Leonid Yuriev
1bc49f680d mdbx++: more songs&dances about constexpr for old/mad compilers.
Change-Id: I00d7629ea9009b918f687f1e2a9f5ca8adba5ac2
2020-09-13 21:22:41 +03:00
Leonid Yuriev
cd4caeb03d mdbx: add mdbx_panic() to C API.
Change-Id: I009a7889311b57ae2210822a8087889f900919f8
2020-09-10 15:37:59 +03:00
Leonid Yuriev
58bcfb006e mdbx: add mdbx_printf_args() macro.
Change-Id: I7fca72f8cc912d8644ecf149b755c78fb3cc7e23
2020-09-10 15:35:43 +03:00
Leonid Yuriev
369612a9b2 mdbx: Merge branch 'master' into c++.
Change-Id: I7431973ca96afe98d991ffd0a876a15e6ed94714
2020-09-10 01:33:32 +03:00
Leonid Yuriev
50c25f479d mdbx++: more Doxygen descriptions and refinement.
Change-Id: Iec4cfa220f140c0fcc858f51283af2f9c4dd7a65
2020-09-10 01:15:35 +03:00
Leonid Yuriev
64e35a1e44 mdbx-doc: add and describe MDBX_SYNC_DURABLE.
Change-Id: Id51e8c764a073e7c502d8d0b95ace0e14510e85b
2020-09-07 12:38:08 +03:00
Leonid Yuriev
f393ae1c51 mdbx-doc: fix typos.
Change-Id: Iff6be053a796f57cc89e29e016a52b7654953cda
2020-09-07 12:38:08 +03:00
Leonid Yuriev
81f82ae7b3 mdbx++: added partial doxygen descriptions and refined some methods.
Change-Id: I98bd4cb6e296970abbd40ffa049eff6051f30135
2020-09-07 03:10:25 +03:00
Leonid Yuriev
2bcd2e510e mdbx: Merge branch 'devel' into c++.
Change-Id: Iedfe7e7ae21d08628c24b4dd5a788bc43cced2f5
2020-09-05 13:48:40 +03:00
Leonid Yuriev
b1877d08ae mdbx: rework mdbx_chk & tree-traversal.
Change-Id: Idc131539426fe0cbb97a105cff2d0a12b1496bfe
2020-09-05 01:57:02 +03:00
Leonid Yuriev
06a8cb1e5a mdbx-doc: Quick reference for Insert/Update/Delete operations.
Change-Id: Iae2011ea431302fae1d1627297a061d6d01f7555
2020-09-05 00:26:06 +03:00
Leonid Yuriev
b095ad872c mdbx: add MDBX_ALLDUPS & MDBX_UPSERT, rework handling of others.
Change-Id: I27d437540d883935d78242e4fc7e28951ab9f496
2020-09-05 00:26:06 +03:00
Leonid Yuriev
33b1cf2931 mdbx++: Initial C++ API (some extra methods are not implemented).
Change-Id: I0478d0c94dcd12b52916e87815e5731817407c3c
2020-09-05 00:26:06 +03:00
Leonid Yuriev
1d48cb88fe mdbx: Add mdbx_txn_break().
Change-Id: Id38a09a0a95d092d75f2eb4fad2cbd7805cd59d0
2020-08-28 21:20:51 +03:00
Leonid Yuriev
ec7126420f mdbx-doc: Quick reference for Insert/Update/Delete operations.
Change-Id: Iae2011ea431302fae1d1627297a061d6d01f7555
2020-08-28 19:08:45 +03:00
Leonid Yuriev
04a77d3bf3 mdbx: add MDBX_ALLDUPS & MDBX_UPSERT, rework handling of others.
Change-Id: I27d437540d883935d78242e4fc7e28951ab9f496
2020-08-28 19:08:45 +03:00
Leonid Yuriev
88a4b8cb9b mdbx++: Initial C++ API (some extra methods are not implemented).
Change-Id: I0478d0c94dcd12b52916e87815e5731817407c3c
2020-08-28 16:45:30 +03:00
Leonid Yuriev
8707fb89f3 mdbx: fix pure attribute for mdbx_key_from_ptrfloat().
Change-Id: I0403aced54d1ecad83079696c01ab3e0813691b0
2020-08-28 16:44:20 +03:00
Leonid Yuriev
0c6cecaacb mdbx-doc: fix Doxygen \see refs.
Change-Id: Ia66553fe9c230931462f19871946afcdd7591e73
2020-08-27 13:19:44 +03:00
Leonid Yuriev
bda4ebc939 mdbx-doc: minor Doxygen refines.
Change-Id: I6417e2c16b3bbb9536e0c0825eea22547163457b
2020-08-23 16:28:00 +03:00
Leonid Yuriev
cb64ba8258 mdbx: add workaround for MSVC-2019 __has_cpp_attribute() bug.
Change-Id: Ie17bc57a9f20dda32af617560641fc1b69dc03a0
2020-08-23 16:23:59 +03:00
Leonid Yuriev
0a75417d5f mdbx: add pure- & const-function attributes to C API.
Change-Id: Ie4d1742f3d4717a0cd1fd5677b9b1ae641193d45
2020-08-23 13:29:44 +03:00
Leonid Yuriev
3292677fe6 mdbx-docs: fix doxygen typo, etc.
Change-Id: I541ad3ecb9b9af015cfac9aad4eb72d8731b8ab2
2020-08-07 12:31:08 +03:00
Leonid Yuriev
ffa10a25d6 mdbx: use enums & bool in the C API.
Change-Id: I952f578cceb7d02ade16f545d47245d4d9106441
2020-08-06 01:48:56 +03:00
Leonid Yuriev
3bcf808005 mdbx: separate and describe MDBX_DB_ACCEDE.
Change-Id: I1a846d196eb00138c1c5ec453537757b1df78d31
2020-08-06 01:48:56 +03:00
Leonid Yuriev
b3dde2bafc mdbx: minor refines for Doxygen.
Change-Id: Iacedc42fc1c7e680306fdae819c165e8b40f6a5a
2020-08-06 01:48:56 +03:00
Leonid Yuriev
87de3fc25f mdbx: add MDBX_TXN_RDONLY_PREPARE.
Change-Id: I95647d1679b69d1e97514a45f20d7373174244d5
2020-08-06 01:48:56 +03:00
Leonid Yuriev
1e7a1da14e mdbx: separate transaction flags.
Change-Id: Ib9a0f6946e1ecf35059e2dccc91319ae130c9f9b
2020-08-06 01:48:56 +03:00