Commit Graph

2687 Commits

Author SHA1 Message Date
Leonid Yuriev
56758372cf mdbx: drop unused mdbx_audit().
Change-Id: I6d31c6ad83c058892319da6bbf38506b3f55085f
2021-01-19 23:53:16 +03:00
Leonid Yuriev
1314b29557 mdbx: add const for bsearch functions.
Change-Id: Ie63eafa145bc8a63ae56b2693aaaf69bd21893aa
2021-01-19 23:53:16 +03:00
Leonid Yuriev
ef7814c018 mdbx: clean zero item of DPL-list.
Change-Id: I7c60f3996783d97cee7cf2f0f9a7b856f4272641
2021-01-19 23:53:16 +03:00
Leonid Yuriev
d50fff8410 mdbx: minor refine mdbx_page_check().
Change-Id: I325c20fe042635a0641cc24f5661408f3476139b
2021-01-19 23:53:16 +03:00
Leonid Yuriev
44089b03df mdbx: minor refine mdbx_page_get().
Change-Id: Ie0ca17883ed88e4d9addf8b90061d25a80d77022
2021-01-19 23:53:16 +03:00
Leonid Yuriev
a906569c58 mdbx: merge branch 'master' into devel-rebase.
Change-Id: I96d944f283029b9c60e45683ee66b4564273b407
2021-01-19 23:51:52 +03:00
Leonid Yuriev
b98895b8c7 mdbx: fix unaligned access to bootid on the meta-pages.
Assume this fixes https://github.com/erthink/libmdbx/issues/153

Change-Id: I062c1bd99795a7b875d1cf60658790c1071a6775
2021-01-18 14:27:58 +03:00
Leonid Yuriev
e766df658c mdbx-backport: avoid 4-byte aligned (i.e. unaligned) access to 64-bit integers.
Historically, the page header provides 4-byte data alignment.
Therefore, unfortunately, the meta page data is also aligned on a 4-byte boundary, but contains 64-bit values.

This commit eliminates potentially unsafe access (SPARC, MIPS, etc) to these 64-bit values aligned on a 4-byte boundary.
Thus, a build with the `-fsanitize=undefined` now passes the tests both with CLANG 11 and GCC 10.

Change-Id: Ie441103e53ed96fd40507d8c0be0689e3fee69f5
2021-01-18 14:08:49 +03:00
Jens Alfke
adc7208169 mdbx-make: Added DLLs and dSYMs to clean & gitignore.
- Added file types .dll, .dylib and .dSYM to .gitignore
- Added above to the file types deleted by `make clean`

Resolves https://github.com/erthink/libmdbx/issues/151
2021-01-07 02:01:45 +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
697fce7ebc mdbx: rename MDBX_END_PURE_COMMIT (cosmetics).
Change-Id: Ia3bdeca5989c841c0dc969e22981044fb334bf32
2020-12-17 22:03:14 +03:00
Leonid Yuriev
70e76bcb4d mdbx: merge branch 'master' into devel.
Change-Id: Idc8838922081cbc8ebe6c564555e4d304b529588
2020-12-17 21:52:35 +03:00
Leonid Yuriev
1ebc1e7c49 mdbx: update ChangeLog.
Change-Id: Ib53b3180b2b8e5437eec649aa010bdd6779d41c9
2020-12-17 17:42:35 +03:00
Leonid Yuriev
760f1654c2 mdbx-test: minor extension for jitter test case.
Trivial test for https://github.com/erthink/libmdbx/issues/146.

Change-Id: If5b365ebedf8609c9ec12569d5e5173799379195
2020-12-17 17:41:24 +03:00
Leonid Yuriev
d77af0bc1f mdbx: more checks against the use renewed (re-created or re-opened) DBI-handles.
More for https://github.com/erthink/libmdbx/issues/146

Change-Id: I09e40598aca18e7ebd9798dc3be8675de3f8d976
2020-12-17 10:36:05 +03:00
Leonid Yuriev
735da5fedd mdbx: auto-shrink env's DBI table.
Change-Id: I9f423dab41863119a4491491e0ecd0a4aee42a82
2020-12-17 01:57:06 +03:00
Leonid Yuriev
cda64ca663 mdbx: rework open/import/export of DBI-handles for robustness
Resolve https://github.com/erthink/libmdbx/issues/146

Change-Id: Idd18dc0d038eeba47668983ecf4ff46eabd16de5
2020-12-17 01:57:02 +03:00
Leonid Yuriev
166ed1c7d4 mdbx: refine prev commit (avoids SIGSEGV but assertion failure).
More related to https://github.com/erthink/libmdbx/issues/146

Change-Id: Ie5277a8cc56421d20a7c9aad83724991b2efdc2d
2020-12-15 15:43:19 +03:00
Leonid Yuriev
3758e7697e mdbx: more checks inside mdbx_cursor_close().
Related to https://github.com/erthink/libmdbx/issues/146

Change-Id: I7b90a0e515aa6320b0e89ec52fe01bc0be126071
2020-12-15 15:07:42 +03:00
Leonid Yuriev
315ef41455 mdbx: use MDBX_PGL_LIMIT for DPL as a soft-limit and options.dp_limit as spilling-pressure to avoid false-positive MDBX_TXN_FULL.
Change-Id: I0caae71d044cefa2f36286c2ae9fe14e356a6b51
2020-12-06 14:42:13 +03:00
Leonid Yuriev
c1210d7c73 mdbx: refine mdbx_page_alloc() to avoid MDBX_TXN_FULL.
More for https://github.com/erthink/libmdbx/issues/123

Change-Id: I527b7e9507f4c2aa565f1567924cfb1c477966dd
2020-12-06 14:39:19 +03:00
Leonid Yuriev
a4df0acb00 mdbx: more logging for FD < STDERR_FILENO.
More for https://github.com/erthink/libmdbx/issues/144

Change-Id: I8dcd3cab8a39b16a1836c88ec92b30d6b0de8b51
2020-12-06 14:35:38 +03:00
Leonid Yuriev
c4944a58d5 mdbx: avoid spelling errors (cosmetics).
Change-Id: Ibf14e003ba740ba757b5403e92fd220e68930ce4
2020-12-05 22:51:45 +03:00
Leonid Yuriev
d116e7235a mdbx-posix: safeguard for DB corruption in case FD <= STDERR_FILENO.
Resolve https://github.com/erthink/libmdbx/issues/144

Change-Id: Ic3467338d494b021fa0d1863c8227976d0a2bcd5
2020-12-05 22:51:45 +03:00
Leonid Yuriev
3e7459b428 mdbx-windows: fix mdbx_realloc() for nullptr and MDBX_AVOID_CRT=ON.
Change-Id: I129221186d65254da5b1d84747e5c59d53864b70
2020-12-05 09:45:03 +03:00
Leonid Yuriev
338de2e1fb mdbx: refine mdbx_page_spill().
More for https://github.com/erthink/libmdbx/issues/132.

Change-Id: I40788c13b54453c17d5e5dae6c3d2f93226f8e00
2020-12-04 15:38:26 +03:00
Leonid Yuriev
12ee5e6cac mdbx: minor refine mdbx_page_flush().
More for https://github.com/erthink/libmdbx/issues/132.

Change-Id: I703e1359d859b8901fcbdf57211f7805cd6d5ff1
2020-12-04 15:38:26 +03:00
Leonid Yuriev
262e4981db mdbx: refactor mdbx_pages_xkeep().
More for https://github.com/erthink/libmdbx/issues/132.

Change-Id: Ie81b5c9efafa06e61d6d983769ff1f11a0e59a1e
2020-12-04 15:38:15 +03:00
Leonid Yuriev
df8260e29a mdbx: add mdbx_pnl_purge_odd().
More for https://github.com/erthink/libmdbx/issues/132.

Change-Id: I1926ee48785f30b82e827a8e1e69be1e7a0a209f
2020-12-04 15:38:15 +03:00
Leonid Yuriev
87c765c7be mdbx: fix/check lower border for dirty-pages list's limits/options.
More for https://github.com/erthink/libmdbx/issues/128.

Change-Id: Ie9dccee5cf90d26968db04f4f6d9afa3018fcf0e
2020-12-04 15:38:15 +03:00
Leonid Yuriev
0b02e080c4 mdbx: use pnl_xmerge() to merge spill-pages lists.
More for https://github.com/erthink/libmdbx/issues/132.

Change-Id: I1f84a2be1fa5da6cf0e2783ff56f7a4c20782a7f
2020-12-04 15:38:15 +03:00
Leonid Yuriev
d9bd306da3 mdbx-load: add -p option (purge subDB).
Change-Id: I678950c99c8b4aea1add4ce548c9b4fe4ab8bfe6
2020-12-03 21:52:22 +03:00
Leonid Yuriev
90309ec0bf mdbx: merge branch 'master' into devel.
Change-Id: Ib1d07cf6eb2e4c76b3be969b28bf2317cb326835
2020-12-03 18:42:10 +03:00
Leonid Yuriev
eb31b765a5 mdbx-tools: use MDBX_SAFE_NOSYNC | MDBX_ACCEDE inside mdbx_load.
Change-Id: Id5a3a447d6b80b96a97ec76c258825583546d791
2020-12-03 17:58:21 +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
84235c7903 mdbx: drop unnecessary MDBX_HUGE_TRANSACTIONS option.
Change-Id: I86116c2bada268d6e0a5c97deff808aaffe3e599
2020-12-03 17:17:28 +03:00
Leonid Yuriev
c5061f9289 mdbx: dynamic dirty-page-list size.
Resolve	https://github.com/erthink/libmdbx/issues/123

Change-Id: I5d9b2d8c2259132617fd2b226b9d9a6790fcad88
2020-12-03 17:17:07 +03:00
Leonid Yuriev
6a5cec1f87 mdbx: refine mdbx_dpl_search().
Change-Id: I8acc87d9c2f306c981ad42cc859d32b7cfd7330e
2020-12-03 10:25:36 +03:00
Leonid Yuriev
d8d89cca7d mdbx: refactor dirty-page-list (preparation to rework).
Change-Id: Ib52bb52f73ef1d31f55838d879de081fc0a140c2
2020-12-03 10:25:36 +03:00
Leonid Yuriev
7210f994fb mdbx-windows: fix mdbx_realloc() for nullptr and MDBX_AVOID_CRT=ON.
Change-Id: I129221186d65254da5b1d84747e5c59d53864b70
2020-12-03 10:25:24 +03:00
Leonid Yuriev
e6eeb17030 mdbx: update ChangeLog.
Change-Id: I694056afe448883b16b8ec769d8a560040044ae5
2020-12-03 09:36:45 +03:00
Leonid Yuriev
a987301204 mdbx++: refine abort/commit.
More for https://github.com/erthink/libmdbx/pull/143

Change-Id: I07de4c43d039f904495f0f4caf586d8764174dcf
2020-12-03 09:32:25 +03:00
sasgas
5c693ccd96 mdbx++: fix missing null assignment.
Resolves https://github.com/erthink/libmdbx/pull/143

Change-Id: Ifb88cebe2f07297a2f6cf70e31ae6abe61a0c0b2
2020-12-03 09:17:36 +03:00
Leonid Yuriev
5636dbf12b mdbx: add mdbx_dpl_alloc() & mdbx_dpl_free().
Change-Id: I0f05ff02d4a45d02faa1076cbb1a2a8e17b7e2b9
2020-12-02 20:07:59 +03:00
Leonid Yuriev
c530c83337 mdbx: drop me_dirtylist field.
Change-Id: I93ee802c1b6ef5c6a2443e19754e1a20dbe0aea9
2020-12-02 20:07:59 +03:00
Leonid Yuriev
0b62453f6d mdbx: introduce MDBX_PGL_LIMIT.
Change-Id: Ifab1156ec22fb0908284298393f52c09c0731829
2020-12-02 20:07:59 +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
42019e0b8d mdbx: add dp_reserve_limit with 1024 default.
More for  More for https://github.com/erthink/libmdbx/issues/128

Change-Id: Ia92b1aea58640f183202495e3f6e2d531057afd2
2020-12-02 12:42:16 +03:00