Commit Graph

2768 Commits

Author SHA1 Message Date
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
4b8b7d5a77 mdbx: refine mdbx_env_set_geometry() internals and 16-bit representation of grow/shrink values.
More for https://github.com/erthink/libmdbx/issues/166.

Change-Id: I7390f954819309ee4a01faf587aee6b5152e44bc
2021-03-14 03:42:52 +03:00
Leonid Yuriev
55620c1d13 mdbx: fix selecting/adjustment values inside mdbx_env_set_geometry() for implicit out-of-range cases.
Fixes https://github.com/erthink/libmdbx/issues/170.

Change-Id: Ibc8754811aa3d9077447220f9fec7a5543e40cc4
2021-03-13 19:55:19 +03:00
Leonid Yuriev
439cccf65f mdbx: minor fix assertion in the prev commit.
One more for https://github.com/erthink/libmdbx/issues/171.

Change-Id: I49be3df948f3dbcc838f3dc307155ac404cfb331
2021-03-13 19:40:18 +03:00
Leonid Yuriev
f7cd08ea48 mdbx: add an explicit/strict check that the environment is open.
More for https://github.com/erthink/libmdbx/issues/171.

Change-Id: Ifbf7f8ba143d19162bd3ed1cf29c21c31b45f0d5
2021-03-13 18:31:45 +03:00
Leonid Yuriev
e43cf081f1 mdbx: fix mdbx_env_info_ex() for a non-open environment case.
Fix the https://github.com/erthink/libmdbx/issues/171.

Change-Id: Iad3d0186ef40dfd40fad1c3ae0dd97f9c1161c16
2021-03-13 17:15:17 +03:00
Leonid Yuriev
a96b6f79c6 mdbx: fix/disallowing implicit subDB deletion via operations on MAIN_DBI.
Change-Id: I3cd786e877f42cef2c0d5556033b2633f8a8ce62
2021-03-13 17:11:35 +03:00
Leonid Yuriev
93f0f21a4c mdbx-tools: minor speedup mdbx_load by adding __hot/__inline for internal functions.
Change-Id: Iee7d2562dbe184475f01ab9a7f9aae11549d7294
2021-03-13 15:48:31 +03:00
Leonid Yuriev
8b5197b108 mdbx-tools: minor rearrange internal fields inside mdbx_load to avoid padding.
Change-Id: Ieca06e0c031938b083fd12959812afa1bbc9e2de
2021-03-13 15:47:59 +03:00
Leonid Yuriev
0603dd8305 mdbx-tools: more for quiet mode inside mdbx_load.
Change-Id: I31839d530b94516c9819e6600fd808a3c97c609a
2021-03-13 15:47:19 +03:00
Leonid Yuriev
f01e0efc2d mdbx-tools: add mdbx_drop tool.
Change-Id: Ib7b32668c13fcef5951ff7250df57b3263e14d69
2021-03-13 15:45:15 +03:00
Leonid Yuriev
fd021d793a mdbx: fix MSVC warning.
More for https://github.com/erthink/libmdbx/issues/166

Change-Id: I47a2ec72831c06695e7ef4c52a77039e52a718e2
2021-03-09 12:59:54 +03:00
Leonid Yuriev
cd90f831af mdbx: refine db growth step default.
Change-Id: Ief80441cb578ae37d5d7cee4766e57eaacb4bbde
2021-03-09 12:59:27 +03:00
Leonid Yuriev
8e51a10908 mdbx: packing the 16-bit representations of grow step and shrink threshold values.
Using float point (exponential quantized) representation for internal 16-bit values
of grow step and shrink threshold when huge ones
.
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.

Resolve https://github.com/erthink/libmdbx/issues/166

Change-Id: I273127c1842deef0d7d8885b55a805b1463556eb
2021-03-09 12:54:48 +03:00
Leonid Yuriev
57af1d2310 mdbx: update ChangeLog.
Change-Id: I675f6a215eb566c89dc3f0f875752999b43fd4b6
2021-03-07 19:46:56 +03:00
Leonid Yuriev
ec95a50bb6 mdbx: fix not setting the dirty flag for @MAIN when dropping DBI.
This fixes https://github.com/erthink/libmdbx/issues/168

Change-Id: Ida9f11fbcea092af17946b95bfe4ac58b822a80c
2021-03-06 20:40:15 +03:00
Leonid Yuriev
b0d449565d mdbx: shrink dbi table immediately in the mdbx_dbi_close_locked().
Change-Id: Idaa5ec9791b5ffa4305e7f9f7a625fba5f956dd9
2021-03-05 03:20:21 +03:00
Leonid Yuriev
de13d6c823 mdbx: merge branch 'master' into devel.
Change-Id: Icec2e7548923ef7b3e33bf50fc20842938d5eec5
2021-03-04 19:23:09 +03:00
Леонид Юрьев (Leonid Yuriev)
c765b3d0b7
Merge pull request #167 from Erk-/patch-1
mdbx: fix compilation on build targets listed below MIPS.
2021-03-04 19:12:53 +03:00
Erk
b2a0279253
Fix compilation on build targets listed below MIPS 2021-03-04 10:33:12 +01:00
Leonid Yuriev
dec11e639a mdbx: fix mdbx_dpl_alloc().
Change-Id: Ia7d4b1866ca3623668edffd56ab83e845f16b2a5
2021-03-03 16:24:32 +03:00
Leonid Yuriev
0cebc50291 mdbx: refine page-rebalance.
Change-Id: Ia94379fa51eb5da1e1ec1a52cc1dd8b67ceb150a
2021-03-03 16:05:52 +03:00
Leonid Yuriev
46dcd6e7ca mdbx: (re)alloc dpl-list at txn start.
Change-Id: Ie35221666f09a189f5513e77d3ecb4056968334f
2021-03-02 03:58:27 +03:00
Leonid Yuriev
8cabd99d24 mdbx: merge branch 'devel'.
Change-Id: I2593f0229694d0bdd310975887e31651ead6dcc0
2021-03-02 02:12:10 +03:00
Leonid Yuriev
c29d3a4ecb mdbx-ci: add --force for all git fetch --tags.
Change-Id: I016e412250dca651fdae65b08aba5d5e204e61b8
2021-03-02 02:01:35 +03:00
Leonid Yuriev
c4b24b6a4d mdbx-tools: minor fix a condition for details output about leaf pages.
Thanks to Alexander Gavrilov (https://github.com/dartraiden) for the hint.

Change-Id: I2a674b7d23310f8c776eef551353f79dfca7a3d8
2021-03-01 23:09:18 +03:00
Leonid Yuriev
c8dccc9bc4 mdbx: limits the initial size of dpl-list to the current db-size.
Change-Id: I5f575fc6168f50786b6f8a82ae020d323530a12e
2021-02-28 01:02:16 +03:00
Leonid Yuriev
72d978ee48 mdbx: weakens checks during set the MDBX_opt_txn_dp_limit to avoid MDBX_EINVAL.
Change-Id: I4852261d0c45b726c60792463ab698538fa447e5
2021-02-28 01:02:16 +03:00
Leonid Yuriev
7fcf11013e mdbx: minor fix likely/unlikely inside mdbx_cursor_del().
Change-Id: I86cfc755eef7371ea96c0feb39bffd3ec5298b71
2021-02-28 01:02:16 +03:00
Leonid Yuriev
d816e0605b mdbx-ci: fix spelling github-action error.
Change-Id: I93c6bfdc59e95fa69f1f440c7bd32f4db3fe6547
2021-02-08 20:29:12 +03:00
Leonid Yuriev
34dcb410a9 mdbx: add reference to Go bindings.
Change-Id: Ib50012e30c0ab98d97024b7268b159aeeb883363
2021-02-07 14:32:27 +03:00
Leonid Yuriev
2727072ad9 mdbx: update README, now we can say - up to 30% faster than LMDB.
Change-Id: I902282d9032ce5d7ea8a95547f02da13d593a42f
2021-02-07 03:14:49 +03:00
Leonid Yuriev
e7dfa98030 mdbx: update Changelog.
Change-Id: Iea4a2cf27c808ed9bbb4e3359050065ac73f3eda
2021-02-07 02:53:54 +03:00
Leonid Yuriev
3fd739ea2c mdbx: add MDBX_DISABLE_PAGECHECKS build option.
Change-Id: Ia5e2727b74961e7f829f273225c5c1a6cc764b8e
2021-02-07 02:53:54 +03:00
Leonid Yuriev
c89f30e485 mdbx: fix/rework C11 atomics usage to avoid performance regression.
Resolve https://github.com/erthink/libmdbx/issues/160

Change-Id: Ic14ef8c9f1e4fb844952f51e81b58268d7939cfe
2021-02-06 21:16:56 +03:00
Leonid Yuriev
016f644815 mdbx: merge branch 'master' into devel.
Change-Id: I04863923fd5a3a4294a96190477ad28562c805fc
2021-02-06 19:36:17 +03:00
Leonid Yuriev
7e7d526ed5 mdbx: minor fix txn_spill().
Change-Id: Ic624681d3a9e262b77f761796aabf0231019db72
2021-02-06 19:34:26 +03:00
Leonid Yuriev
0e8c913c57 mdbx: minor refine node_search().
Change-Id: Ib9aaca3e7853b9986b6d70bc43a88e90d0a46c0c
2021-02-06 19:33:07 +03:00
Leonid Yuriev
892402a5d8 mdbx: add missing unlikely() hints.
Change-Id: I0baae944b9d2a994ad65fbb57591c2cc8d35f0d3
2021-02-06 19:31:04 +03:00
Leonid Yuriev
0cc695e22e mdbx: minor simplify page_get().
Change-Id: I2a548ea008fad29da8382946dff3c7d9bffa1e85
2021-02-06 19:30:05 +03:00
Leonid Yuriev
cc7c41a9c0 mdbx-ci: use --force to avoid errors while fetching flags.
Change-Id: I8ba31e2f6cfd9b396d6706c71ed0ff42493f7fe9
2021-02-04 19:24:23 +03:00
Leonid Yuriev
d78150de79 mdbx-ci: hotfix for github-action+git issue.
Change-Id: I235a9d5a55c284aa545fc2a18fb7cb8411747f89
2021-02-02 22:34:42 +03:00
Leonid Yuriev
be220dc905 mdbx: release v0.9.3
Acknowledgements:
-----------------
 - [Mahlon E. Smith](http://www.martini.nu/) for [FreeBSD port of libmdbx](https://svnweb.freebsd.org/ports/head/databases/mdbx/).
 - [장세연](http://www.castis.com) for bug fixing and PR.
 - [Clément Renault](https://github.com/Kerollmops/heed) for [Heed](https://github.com/Kerollmops/heed) fully typed Rust wrapper.
 - [Alex Sharov](https://github.com/AskAlexSharov) for bug reporting.
 - [Noel Kuntze](https://github.com/Thermi) for bug reporting.

Removed options and features:
-----------------------------
 - Drop `MDBX_HUGE_TRANSACTIONS` build-option (now no longer required).

New features:
-------------
 - Package for FreeBSD is available now by Mahlon E. Smith.
 - New API functions to get/set various options (https://github.com/erthink/libmdbx/issues/128):
    - the maximum number of named databases for the environment;
    - the maximum number of threads/reader slots;
    - threshold (since the last unsteady commit) to force flush the data buffers to disk;
    - relative period (since the last unsteady commit) to force flush the data buffers to disk;
    - limit to grow a list of reclaimed/recycled page's numbers for finding a sequence of contiguous pages for large data items;
    - limit to grow a cache of dirty pages for reuse in the current transaction;
    - limit of a pre-allocated memory items for dirty pages;
    - limit of dirty pages for a write transaction;
    - initial allocation size for dirty pages list of a write transaction;
    - maximal part of the dirty pages may be spilled when necessary;
    - minimal part of the dirty pages should be spilled when necessary;
    - how much of the parent transaction dirty pages will be spilled while start each child transaction;
 - Unlimited/Dynamic size of retired and dirty page lists (https://github.com/erthink/libmdbx/issues/123).
 - Added `-p` option (purge subDB before loading) to `mdbx_load` tool.
 - Reworked spilling of large transaction and committing of nested transactions:
    - page spilling code reworked to avoid the flaws and bugs inherited from LMDB;
    - limit for number of dirty pages now is controllable at runtime;
    - a spilled pages, including overflow/large pages, now can be reused and refunded/compactified in nested transactions;
    - more effective refunding/compactification especially for the loosed page cache.
 - Added `MDBX_ENABLE_REFUND` and `MDBX_PNL_ASCENDING` internal/advanced build options.
 - Added `mdbx_default_pagesize()` function.
 - Better support architectures with a weak/relaxed memory consistency model (ARM, AARCH64, PPC, MIPS, RISC-V, etc) by means [C11 atomics](https://en.cppreference.com/w/c/atomic).
 - Speed up page number lists and dirty page lists (https://github.com/erthink/libmdbx/issues/132).
 - Added `LIBMDBX_NO_EXPORTS_LEGACY_API` build option.

Fixes:
------
 - Fixed missing cleanup (null assigned) in the C++ commit/abort (https://github.com/erthink/libmdbx/pull/143).
 - Fixed `mdbx_realloc()` for case of nullptr and `MDBX_AVOID_CRT=ON` for Windows.
 - Fixed the possibility to use invalid and renewed (closed & re-opened, dropped & re-created) DBI-handles (https://github.com/erthink/libmdbx/issues/146).
 - Fixed 4-byte aligned access to 64-bit integers, including access to the `bootid` meta-page's field (https://github.com/erthink/libmdbx/issues/153).
 - Fixed minor/potential memory leak during page flushing and unspilling.
 - Fixed handling states of cursors's and subDBs's for nested transactions.
 - Fixed page leak in extra rare case the list of retired pages changed during update GC on transaction commit.
 - Fixed assertions to avoid false-positive UB detection by CLANG/LLVM (https://github.com/erthink/libmdbx/issues/153).
 - Fixed `MDBX_TXN_FULL` and regressive `MDBX_KEYEXIST` during large transaction commit with `MDBX_LIFORECLAIM` (https://github.com/erthink/libmdbx/issues/123).
 - Fixed auto-recovery (`weak->steady` with the same boot-id) when Database size at last weak checkpoint is large than at last steady checkpoint.
 - Fixed operation on systems with unusual small/large page size, including PowerPC (https://github.com/erthink/libmdbx/issues/157).

TODO:
-----
 - Engage new terminology (https://github.com/erthink/libmdbx/issues/137).
 - Resolve few TODOs (https://github.com/erthink/libmdbx/issues/124, https://github.com/erthink/libmdbx/issues/127,    https://github.com/erthink/libmdbx/issues/115).
 - Finalize C++ API.
 - Packages for [ROSA Linux](https://www.rosalinux.ru/), [ALT Linux](https://www.altlinux.org/), Fedora/RHEL, Debian/Ubuntu.

Change-Id: I414b8ef2e4b90e04fb344779c0e3f1b4bd1c06be
2021-02-02 22:18:21 +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
38a559b93e mdbx: Crutches for C11-atomics compiler's bugs.
Change-Id: I5a857aa56c831f00c4bc67c95d7aecabc29264da
2021-02-01 20:55:41 +03:00
Leonid Yuriev
2b290e08ea mdbx: update ChangeLog.
Change-Id: Ib7af5490a2d8138bdd65403df3f0552e68e30425
2021-02-01 02:14:28 +03:00
Leonid Yuriev
25c4df0d3e mdbx: radix sort for large chunks of PNL and DPL.
More for https://github.com/erthink/libmdbx/issues/132

Change-Id: I19b253f78069d4ecd4ec360a12121c78f182fc09
2021-02-01 02:14:13 +03:00
Leonid Yuriev
88bdf4b96f mdbx: avoid branches inside bsearch() loop.
Related for https://github.com/erthink/libmdbx/issues/132

Change-Id: Ia843556cc7052e5081a98f56b43fd80e2d0a40c7
2021-02-01 00:39:52 +03:00
Leonid Yuriev
28bd5d81d2 mdbx: incremental lazy merge sort for dirty-page list.
The main change for https://github.com/erthink/libmdbx/issues/132

Change-Id: I9907f6abfcf77bd40c7a263f5adb5274d5445864
2021-02-01 00:39:19 +03:00
Leonid Yuriev
0620ec2f2e mdbx: merge branch master into the devel.
Change-Id: Iab3a0502577f6557e3f8fccc89df49aee372416e
2021-01-31 23:21:16 +03:00