873 Commits

Author SHA1 Message Date
Leonid Yuriev
06193f4267 mdbx: refine page-number-list checking.
Change-Id: I89524075b416eb8bc63b1e0910baf3a37d6589f4
2019-10-14 17:28:53 +03:00
Leonid Yuriev
137b19aac2 mdbx: workaround for Apple-LLVM bug.
Change-Id: Ib1b504240d71fe20cc306b81b175bbb63737bea0
2019-10-12 23:05:22 +03:00
Leonid Yuriev
3df5f60a70 mdbx: include <malloc_np.h> for FreeBSD & OpenBSD.
Change-Id: I4b9c29bf63a03c281017f50bbdfe3495740804af
2019-10-12 22:47:27 +03:00
Leonid Yuriev
bb922c208c mdbx: add mdbx_is_readahead_reasonable().
Change-Id: Iac090a9050d6b046b62b2c79cefbc70cc62c9144
2019-10-12 22:38:36 +03:00
Leonid Yuriev
c51a6e6d95 mdbx: move madvise(MADV_RANDOM) to under control of MDBX_NORDAHEAD flag.
Change-Id: Ied2473ad054797a20ec2c177106a9a7e85fab1d1
2019-10-12 11:07:21 +03:00
Leonid Yuriev
e04ea50c18 mdbx: refine madvise(MADV_REMOVE_OR_FREE_OR_DONTNEED), add 256K threshold.
Change-Id: I1fe314fa10062dca0870ec035454370bfacf20f0
2019-10-12 11:07:21 +03:00
Leonid Yuriev
f6ba670cd0 mdbx: minor fix for __gnu_linux__.
Change-Id: Ic262bf863927fe86ab0091d809388569f0d59bec
2019-10-12 11:07:21 +03:00
Leonid Yuriev
8921da2787 mdbx: fix internal comments.
Change-Id: Ica95587f74501e78259805cba4393a430af0437b
2019-10-12 11:07:21 +03:00
Leonid Yuriev
4560ddcd1e mdbx: refine ending of read-only transactions.
Change-Id: I56d07d75e4f5f64fd34e5b780024c145eb8299ed
2019-10-12 11:07:21 +03:00
Leonid Yuriev
99e9956410 mdbx: make mdbx_env_set_geometry() behavior equal to LMDB (i.e. fixed size).
Change-Id: I26dfcbb03362dde6fbf4b0f59530ddbf4e2b0723
2019-10-11 16:54:55 +03:00
Leonid Yuriev
8861f1377c mdbx: roundup buffer size inside env_copy2fd().
Change-Id: Iaa9d1adb934d36a28be3804683ffbaf43552d54b
2019-10-11 14:16:49 +03:00
Leonid Yuriev
4d692821cb mdbx: partial workaround for ASAN false-positive (due internal bug).
Change-Id: Ib86e187e58f3efbb5e5da95219f1b6e990022b9a
2019-10-11 14:16:15 +03:00
Leonid Yuriev
3c4d87520e mdbx: drop NEXT_LOOSE_PAGE macro.
Change-Id: Icee989a7bcd89a5fcd2664c6a9a99cdc546cc8f1
2019-10-11 01:06:26 +03:00
Leonid Yuriev
39c1238d8e mdbx: refine Valgrind support (i.e. avoid false-positives).
Change-Id: I688b2e905d0b705c34ab29df29bfd0a9bcdde8c9
2019-10-11 01:06:26 +03:00
Leonid Yuriev
ab01078cd7 mdbx: refine/fix SORT_IMPL macro.
Change-Id: Ifc2968ead891c97442cec85076f7824a285f84b8
2019-10-11 01:06:12 +03:00
Leonid Yuriev
a6aad9c918 mdbx: use malloc_usable_size() and analogues.
Change-Id: I35b3fe0f1a1c884ba2013c9a861057b38f6a2174
2019-10-10 22:36:53 +03:00
Leonid Yuriev
e519b8f315 mdbx: fix memleak after write-txn state rework.
Change-Id: I001d1d82c8091de1420617e98820ca7d6b69fe4a
2019-10-10 22:15:47 +03:00
Leonid Yuriev
e5caec031f mdbx: fix warnings from old/obsolete clang (minor).
Change-Id: I4eaaa45bf2ebd68efb572dad04ba025e2608f968
2019-10-10 00:29:43 +03:00
Leonid Yuriev
273af26244 mdbx: rework nested transactions and write-transaction state.
This resolves https://github.com/leo-yuriev/libmdbx/issues/62

Change-Id: Icbd762ca69ab1ccf8c3440c71931d2ac14599a1b
2019-10-09 23:27:01 +03:00
Leonid Yuriev
1c9c637701 mdbx: refine internal audit for intermediate state checking.
Change-Id: Iba2b7e5b8df09374c9bf941cc5efa1ed6e826288
2019-10-09 13:37:46 +03:00
Leonid Yuriev
cee1aeaf26 mdbx: fix comment typo.
Change-Id: I2c48e039ee0b135966a66aa2f33ba5c4897a4bc3
2019-10-09 13:37:24 +03:00
Leonid Yuriev
64016c86f6 mdbx: add minor assertions info mdbx_env_walk().
Change-Id: Ibeff6a52088fc858d00b6625a2754aceffb1a382
2019-10-09 13:36:50 +03:00
Leonid Yuriev
6efe0686c9 mdbx: fix Coverity warnings.
Change-Id: I70734c5bf7e3d1088522c0dccd88948865f8192f
2019-10-06 19:05:08 +03:00
Leonid Yuriev
7d621f6f0a mdbx: auto-define _GNU_SOURCE under control of MDBX_DISABLE_GNU_SOURCE.
Change-Id: I314d88b86517e3c44ad35fe02d3a27cb987c6d60
2019-10-06 18:45:52 +03:00
Leonid Yuriev
440bfec193 mdbx: allow 256-byte pages.
Change-Id: I697de67683fb040ea0e360515a5a0839d97e9aa6
2019-10-05 23:36:55 +03:00
Leonid Yuriev
8291de71cb mdbx: support keys and dupsort values upto maxnode (half of a page) size.
Change-Id: I7717d55a0d6a7fdc4dc3caba8f8d3ad46a132f61
2019-10-05 23:36:55 +03:00
Leonid Yuriev
d9e1d7f23a mdbx: fix assertions inside pnl_search().
Change-Id: I735e54823b64a1ca03d7132c9ccc4e443d9b25a5
2019-10-04 18:52:15 +03:00
Leonid Yuriev
aa92d6b7e7 mdbx: add paranoid assertions to qsort and bsearch macros.
Change-Id: I68efcf83576dd01e2f0c37ca8afb30967f5369a9
2019-10-04 18:52:15 +03:00
Leonid Yuriev
529d484884 mdbx: fix audit for retired-pages tracking (minor, i.e. false-negative).
Change-Id: Ied44bc18efec7178ca5cc5f3324cfc75be24125a
2019-10-04 18:52:15 +03:00
Leonid Yuriev
39d43a5b57 mdbx: alter mdbx_cursor_put() paths.
Change-Id: I1836f8237162ffa34ce432038131fb6171fb7104
2019-10-04 18:52:15 +03:00
Leonid Yuriev
9e92ea2372 mdbx: add mdbx_page_check().
Change-Id: I8350d774f841726ca967be732593e33bfa8a6230
2019-10-04 18:52:15 +03:00
Leonid Yuriev
8768641872 mdbx: refine/simplify MDBX_node.
Change-Id: Idb3843727a409c3ef8d1d54e226a6f578a57c32e
2019-10-04 15:59:03 +03:00
Leonid Yuriev
daddd53793 mdbx: refine mdbx_page_copy().
Change-Id: I73ad272b468430e7bf79462750887e75ef71bd60
2019-10-04 15:59:03 +03:00
Leonid Yuriev
bf818ddf1e mdbx: fix assertion inside mdbx_txn_begin().
Change-Id: I0184c094e0f1fdc1a3ed9aede803cbfc2595ff05
2019-10-04 15:59:03 +03:00
Leonid Yuriev
315e58578d mdbx: don't log empty file read error upon creation it.
Change-Id: I9cb9f9bee23817331f91ffd0847c599cf1dc0a25
2019-10-02 00:12:04 +03:00
Leonid Yuriev
4d49112a56 mdbx-test: refix logging.
Change-Id: I8852cca84669b4da2a994f2d5d2cec833e21f2f6
2019-10-02 00:12:04 +03:00
Leonid Yuriev
e1e2e2e935 mdbx: provide additional info via mdbx_env_info_ex().
Change-Id: Icfc751da73f090833800ad5429a9b296b4e34700
2019-10-01 17:09:57 +03:00
crypto.sowle
f918d89408 mdbx: English translation for osal.h
Change-Id: Iec7c3334f1866df243e7fcec89858ef37415a4a2
2019-10-01 16:27:38 +03:00
Leonid Yuriev
f0246463c0 mdbx: rework sync_timestamp.
Change-Id: I0e9ef9722735f89055814ba7eec0610ecdea8f0a
2019-10-01 15:01:33 +03:00
Leonid Yuriev
5693fad51d mdbx: add mdbx_osal_monotime_to_16dot16().
Change-Id: Ia65057def67cebf67252a77665efde4223b14d10
2019-10-01 14:47:26 +03:00
Leonid Yuriev
83da954725 mdbx: rework env_sync() for MDBX_NOMETASYNC, add mdbx_env_sync_poll().
Change-Id: I4d212c663853b00e221d17cb8483353231497b48
2019-09-30 00:15:13 +03:00
Leonid Yuriev
91ee841fc2 mdbx: clarify mdbx_env_set_flags().
Change-Id: I45d9af8cbaf9710e78c93d157c70fc2d305f3100
2019-09-30 00:15:13 +03:00
Leonid Yuriev
87f8c01ac4 mdbx: add space argument for oom-callback.
Change-Id: I27634e02046df375fffae66de3124e8cd90cc61c
2019-09-30 00:15:13 +03:00
Leonid Yuriev
86496e4480 mdbx: refine retired-next-reader insode mdbx_txn_info().
Change-Id: Iba57365cc4b7f4f09a0698502bc7aafcb6e67478
2019-09-28 14:41:49 +03:00
Leonid Yuriev
dcd3c497d9 mdbx-windows: rename mdbx_dll_handler() to avoid confusion with callbacks.
Change-Id: I1ee9e9aa46da33f06cf935d3be059f938416efb5
2019-09-28 00:46:16 +03:00
Leonid Yuriev
e41369fbc6 mdbx-build: minor fix build-info & options.
Change-Id: I72020c99a081845a155d7fda2ff30b7907124760
2019-09-27 11:33:30 +03:00
Leonid Yuriev
20447c877d mdbx: refine mdbx.h and API description, etc (5 of 5).
Change-Id: I851736cccb4d0271d6f351e1358cc5c4e1257bb4
2019-09-27 02:28:17 +03:00
Leonid Yuriev
1ab33333bc mdbx: refine options and build-info.
Change-Id: Ib1a778dd27a0ea8b3a05484b2208e2222736b2d3
2019-09-25 19:03:04 +03:00
Leonid Yuriev
40ee895aae mdbx: refine internal debug facilities.
Change-Id: I934cb8587f07c59268b16a0dd99daeb7ac440e62
2019-09-24 10:07:50 +03:00
Leonid Yuriev
a0025d84fd mdbx: refine txnid-safety for 32-bit archs.
Change-Id: I21d3a50fbc7ae0c625c51e919cb214740c1e97cb
2019-09-23 23:04:39 +03:00
Leonid Yuriev
b3c2118eb4 mdbx: explicity types inside LCK-file, reserve ABA-solver for 32-bit archs.
Change-Id: I2d1235365709858e2deb9f195f0fe8403721c705
2019-09-23 23:04:39 +03:00
Leonid Yuriev
3549744f40 mdbx: incremental/combined linear+binary search for dirty-pages list.
Change-Id: I20f606a0a5d3729bfc92cb20c9db00cc1971d2ad
2019-09-23 14:24:01 +03:00
Leonid Yuriev
f3a51be7ff mdbx: rewrite internal bsearch for pages-lists.
Change-Id: I77615a2146d83d4304c05c3bafb8bfc89a1a4fd0
2019-09-23 14:24:01 +03:00
Leonid Yuriev
aceab9be44 mdbx: replace internal qsort implementation (up to 25% faster).
Change-Id: I20cd1c7cf9d5d7dbf70f5fb1865efeecb4bc42fc
2019-09-23 14:24:01 +03:00
Leonid Yuriev
5a94d734cc mdbx: auto-sorting for dirty-pages list.
Change-Id: I12f3de68c020aeacba2ac80cedf4cae6cb590c6b
2019-09-23 14:23:55 +03:00
Leonid Yuriev
83fbcb660f mdbx: add mdbx_txn_info().
Change-Id: I7bef500c23899874c996694b7cc52a38366730f0
2019-09-21 18:15:43 +03:00
Leonid Yuriev
0b500798df mdbx: refund loose-pages.
Change-Id: I33a5916b1a0876dde28f88658ab20a6a29fdccd7
2019-09-21 18:15:43 +03:00
Leo Yuriev
44d94a76e5 mdbx: maintaining retired pages sequence. 2019-09-21 01:36:55 +03:00
Leo Yuriev
c80a5cabd6 mdbx: internal rename befree to retired.
Change-Id: Ic72449fe242df0f0f88b671e56570e00b5e6202f
2019-09-20 20:44:35 +03:00
Leo Yuriev
8423a0a8bd mdbx: txnid-safety for non-64-bit and/or not-atomic platforms. 2019-09-20 20:23:25 +03:00
Leonid Yuriev
d15a6b935c mdbx: avoid "unused static function" warnings.
Change-Id: I438a9fa3fa099ad96bca5c1af1f528da4a01ddff
2019-09-19 14:04:10 +03:00
Leonid Yuriev
ab456bf376 mdbx-cmake: fix MDBX_BUILD_FLAGS list-case.
Change-Id: I4c2ce187e31ba3f7b225049b1c96a81fbfd9dead
2019-09-19 03:31:48 +03:00
Leonid Yuriev
7c39c16829 mdbx-tools: rework mdbx_reader_list() & mdbx_stat.
Change-Id: I0524cad93ca439e74eba9486cbcbeacf4253dd84
2019-09-19 01:21:35 +03:00
Leonid Yuriev
2f2df1ee76 mdbx: implement MDBX_TXN_CHECKOWNER option.
Change-Id: Ia283dc9c4d984de1e74915481118f7f4fb5ba5c8
2019-09-18 22:34:05 +03:00
Leonid Yuriev
8fa718c5f9 mdbx: refine mdbx.h and API description, etc (4 of 5).
Change-Id: I36955c54f55facfb31b403f12fe6fd16c789e167
2019-09-18 04:00:57 +03:00
Leonid Yuriev
89db804c1a mdbx: refine geo-params management inside txn.
Change-Id: I70acfe4542ea3f8d878bdb7bfba422233dcce8ef
2019-09-17 23:53:38 +03:00
Leonid Yuriev
d1327b016d mdbx: refine PID checking mdbx_env_close_ex() for closing-after-fork.
Change-Id: I5669b3477ef2e5fc30d6211668a01d3ac78ee163
2019-09-17 01:04:25 +03:00
Leonid Yuriev
86f2710c2e mdbx: return MDBX_RESULT_TRUE/FALSE from mdbx_env_sync_ex().
Change-Id: Ia39051ef137df7892181d936e1139ab2a7c94ab4
2019-09-16 22:30:58 +03:00
Leonid Yuriev
e03addc8f9 mdbx: ensure to sync meta-mages in env_sync_ex().
Change-Id: I540c8353d47acc2e46d6c3a26cfe3e4f6d9249bf
2019-09-16 21:54:43 +03:00
Leonid Yuriev
78da9e52c4 mdbx: return consistency info from mdbx_env_stat().
Change-Id: Ia53259a8590118adf01b03a6eb7835c62376ad1f
2019-09-16 20:55:45 +03:00
Leonid Yuriev
0d4092f4ea mdbx: add to env_copy() support for pipe/socket.
Change-Id: Ib2fc0249b494b885f28265f877de9953f089b403
2019-09-16 19:24:36 +03:00
Leonid Yuriev
b19e180fab mdbx: refine mdbx.h and API description, etc (3 of 5).
Change-Id: I05890bdf2e29c6c5a4b1f861f5bfda920e970126
2019-09-16 02:25:06 +03:00
Leonid Yuriev
4022110955 mdbx: reset returning-by-pointer result on error.
Change-Id: I5e0aa1eae343dc9acc36a95e4f7e11104efc83ce
2019-09-15 22:10:39 +03:00
Leonid Yuriev
5f22a5568d mdbx: allow MDBX_MAPASYNC for particular txn.
Change-Id: I0ed1a7567a3f7bfbae2bfa6995ad8f6c327d91a9
2019-09-15 22:10:15 +03:00
Leonid Yuriev
1402a511a4 mdbx: drop dup-defines MDBX_TXN_NOMETASYNC, MDBX_TXN_NOSYNC, MDBX_TXN_RDONLY. etc.
Change-Id: I7edef9477e15cb6c2291fe82c1b014ff81d2383a
2019-09-15 18:19:46 +03:00
Leonid Yuriev
4bcc1eef09 mdbx: disallow multi-opening without MDBX_DBG_LEGACY_MULTIOPEN.
Change-Id: I0e11d686954bd8c89dac9a46b4c5e17bc0dd6419
2019-09-12 21:41:57 +03:00
Leonid Yuriev
c8928675c6 mdbx: automatically create database directory.
Change-Id: Ic1d4c9ce6f29924f5c112afc3065f08584307d39
2019-09-12 14:56:07 +03:00
Leonid Yuriev
1d08f9e673 mdbx: refine mdbx.h and error strings (1 of 5).
Change-Id: Iaa6c4afeb9268d916ef1e8e23fdf12b7f603869f
2019-09-12 14:18:10 +03:00
Leonid Yuriev
eb4159ac88 mdbx-posix: support to close environment after fork() from a child process.
Change-Id: I20ab9cf4525bfcacd10043e2afe7e1aa26a2af6c
2019-09-12 01:19:23 +03:00
Leonid Yuriev
4b979826ec mdbx: fix update_gc() to avoid leaking values from uninit malloc'ed mem.
Change-Id: I5b98fc9f5d26ffdfe90af81d9fdd07f49c1e85c9
2019-09-12 00:09:25 +03:00
Leonid Yuriev
712bad5935 mdbx-cmake: avoid '-NOTFOUND' inside MDBX_BUILD_FLAGS.
Change-Id: Ia8974d0ffa092a5ffbfe553af49926c3532c88a3
2019-09-11 22:04:28 +03:00
Leonid Yuriev
8231aa5b47 mdbx-posix: avoid Coverity warnings (don't try to recover mutex if unlock failed).
Change-Id: Iaa5b567c810b7e3fd6f5003111e41b752d83b8bb
2019-09-11 21:47:31 +03:00
Leonid Yuriev
7d9d3528c5 mdbx-cmake: fix definitions prefix. 2019-09-11 21:32:25 +03:00
Leonid Yuriev
4ea1d2f8d2 mdbx: accept MDBX_EACCESS and MDBX_EPERM for without-LCK read-only mode.
Change-Id: I024243184c06ddf86bcc62d6e4b1b951d21789d5
2019-09-11 20:40:06 +03:00
Leonid Yuriev
6fc3b89f79 mdbx: add reader_check_timestamp info LCK.
Change-Id: I2f53b5996def8ff1d87a011fc662b94e2be3c467
2019-09-11 19:13:24 +03:00
Leonid Yuriev
0d8b59fa3b mdbx: check readers while opening.
Change-Id: Ieefc78d0d3922e3f98efa557f8e67aada68c4841
2019-09-11 18:58:51 +03:00
Leonid Yuriev
8f08e1c7ed mdbx: fix cross-build & qemu-testing issues.
Change-Id: I6b2343cc4e08c3cb706a190c4c515965182733a2
2019-09-11 18:58:51 +03:00
Leonid Yuriev
228a74c41d mdbx-chk: refine/fix for MAX_DBI case.
Change-Id: Ie0deb701bcb35634951c8080d57294682937b5b7
2019-09-11 18:58:51 +03:00
Leonid Yuriev
17ba1f4d22 mdbx-cmake: fix/refine RPATH for tools.
Change-Id: Id97db43475b757f74eb5a5532390e0e65d610df0
2019-09-11 02:09:21 +03:00
Leonid Yuriev
5cfcc0e3c1 mdbx-cmake: add template for build amalgamated source code.
Change-Id: Ie0908ab62460eb51f2f050fcce915fe4e64f61ca
2019-09-11 02:09:21 +03:00
Leonid Yuriev
5e9e417cf6 mdbx-install: refine cmake-install, install man-pages. 2019-09-11 00:56:07 +03:00
Leonid Yuriev
acc6969594 mdbx-tools: minor refine mdbx_chk.
Change-Id: I71db479944a305f03019d985b91a39cd51ba9981
2019-09-10 19:28:07 +03:00
Leonid Yuriev
aa1c609c28 mdbx: set MIN_TXNID=1.
Change-Id: If67d371c0681d7b85886c83b423d1b9c039d18c3
2019-09-10 19:27:46 +03:00
Leonid Yuriev
7433436ec5 mdbx: add man-page for mdbx_chk, refine other.
Change-Id: I0c5026f0b753525ec5b21e11957c23bf570fbe0b
2019-09-10 19:01:39 +03:00
Leonid Yuriev
d1d1258591 mdbx-build: made 'config.h' optional.
Change-Id: Iafc968cb7000f77cf23169ce07b532386bbce029
2019-09-10 15:52:37 +03:00
Leonid Yuriev
3ec081c187 mdbx-build: add 'make dist' target.
Change-Id: I72c2ff2f90e9da4664bf542761fe445bb713a67a
2019-09-10 02:28:41 +03:00
Leonid Yuriev
e7095e9ada mdbx: remove UTF8-BOM (preparation for 'make dist').
Change-Id: I2d0ccc9f7bbed6d57b2fe6ef156f33531a4eeb69
2019-09-10 02:18:50 +03:00
Leonid Yuriev
be72cd81dc mdbx: add MDBX_MIN_PAGESIZE & MDBX_MAX_PAGESIZE.
Change-Id: I66ba4b637ed5acabb734bbd380e618e01019ade2
2019-09-10 02:13:33 +03:00
Leonid Yuriev
449307a69f mdbx-build: sourcery pinning (but cmake requires manually config-files removal for now). 2019-09-09 14:29:05 +03:00
Leonid Yuriev
0667f4f211 mdbx-windows: define the dll's entry point only depending on the MDBX_AVOID_CRT option. 2019-09-09 11:32:50 +03:00