424 Commits

Author SHA1 Message Date
Leo Yuriev
d0ddc8569b mdbx-windows: fix lck_reader_alive_check().
Change-Id: Icbc54d9b3003f70bba573a3807c5161380339460
2018-05-04 02:17:21 +03:00
Leo Yuriev
f1edd1579a mdbx: fix wrong freeDB search.
Avoid search freeDB while tree is updating.

This resolves https://github.com/leo-yuriev/libmdbx/issues/31
Bug was inherited from LMDB.

Change-Id: I0b12f8d9b88bca5aa26ca27db81df9b72c6a19b7
2018-04-25 03:01:12 +03:00
Leo Yuriev
d127c28e83 mdbx-windows: fix srw-release if rdt-lock failed (minor/paranoia). 2018-04-12 00:56:58 +03:00
Leo Yuriev
159d676429 mdbx: fix typo in mdbx_chk output. 2018-04-10 21:12:41 +03:00
Leo Yuriev
f4a9018690 mdbx: bump internal version info to v0.1.3
Change-Id: I7db311c812d531f6628101715f6658005db3ea24
2018-04-03 20:37:07 +03:00
Leo Yuriev
797ae9d1db mdbx: minor fix debug-output for mdbx_thread_key_create().
Change-Id: I718130cf2385b6221187cbcdeedd9d48d05289bb
2018-04-03 20:04:10 +03:00
Leo Yuriev
864be54f01 mdbx: fix/rework rthc counting.
Change-Id: I97fd5bd6dc1a46658138d82db10e937c9595d81f
2018-04-03 19:28:12 +03:00
Leo Yuriev
571b50622e mdbx: restore workaround for glibc's bug #21031.
Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=21031

Change-Id: I6cf9e037cc2fc298096b78ec96773f19478ed5c0
2018-04-03 17:44:18 +03:00
Leo Yuriev
36a86bbc6e mdbx: fix cursor tracking inside mdbx_rebalance(). 2018-03-26 20:20:14 +03:00
Leo Yuriev
02fc5fe158 mdbx: update internal version info. 2018-03-23 17:23:28 +03:00
Leo Yuriev
45f159ddd3 mdbx: mdbx_cursor_put(MDBX_APPEND+MDBX_NOOVERWRITE) should return MDBX_KEYEXIST instead of MDBX_EKEYMISMATCH.
When MDBX_APPEND is used the ordering of keys is important.
Therefore MDBX_EKEYMISMATCH should me returned when given key <= last.

On the other hand, if MDBX_NOOVERWRITE is also used
then the MDBX_KEYEXIST should be returned, but not MDBX_EKEYMISMATCH.
2018-03-23 17:21:27 +03:00
Leo Yuriev
6758348046 mdbx: import intrin-includes from t1ha. 2018-03-22 21:11:26 +03:00
Leo Yuriev
61a2c56784 mdbx: fix/rework cache-line alignment. 2018-03-22 21:11:26 +03:00
Leo Yuriev
6a074cb85a mdbx: fix unaligned access to mp_ptrs[] on fake-page.
Based on http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commitdiff;h=e77918a903d980ff789b7e32f71725481e870510
2018-03-22 21:11:26 +03:00
Leo Yuriev
dbc87a8a5e mdbx: refine MDBX_CACHE_IS_COHERENT. 2018-03-22 20:38:20 +03:00
Leo Yuriev
c52a57dac5 mdbx: fix for MIPS cacheflush(). 2018-03-22 20:37:50 +03:00
Leo Yuriev
5ce40269b3 mdbx: fix gcc warning (minor). 2018-03-22 20:37:50 +03:00
Leo Yuriev
86274513f9 mdbx: more __has_include(). 2018-03-21 22:19:17 +03:00
Leo Yuriev
f5571e4027 mdbx: import byte-order macros from t1ha. 2018-03-21 22:19:17 +03:00
Leo Yuriev
62ae928b40 mdbx: add neutral __ia32__ and __amd64__ marcos. 2018-03-21 22:18:57 +03:00
Leo Yuriev
a282965aa0 mdbx: add check __ALIGNED__ for UNALIGNED_OK macro. 2018-03-21 21:10:57 +03:00
Leo Yuriev
475da5bcfe mdbx: make mdbx_txn_lock() and mdbx_txn_unlock() exportable for mdbx_chk. 2018-03-20 22:19:32 +03:00
Leo Yuriev
679fb56787 mdbx: lookup suitable txnid for rollback to avoid meta-pages clashes. 2018-03-20 22:16:15 +03:00
Leo Yuriev
dd6cb30820 mdbx-chk: directly use mdbx_txn_lock() for write/recovery mode. 2018-03-20 21:37:42 +03:00
Leo Yuriev
e8dd15088a mdbx: add __ARM_FEATURE_UNALIGNED __e2k__ for UNALIGNED_OK. 2018-03-19 19:59:00 +03:00
Leo Yuriev
d0e1c02a8a mdbx-chk: rework/fix read-write mode. 2018-03-19 18:08:45 +03:00
Leo Yuriev
a2ec7f2be1 mdbx: add mdbx_txn_flags(). 2018-03-19 18:08:45 +03:00
Leo Yuriev
64613c9061 mdbx: fix minor memleak (Coverity). 2018-03-19 16:16:31 +03:00
Leo Yuriev
c05d179035 mdbx: temporary workaround for Elbrus's libc bug.
https://bugs.mcst.ru/bugzilla/show_bug.cgi?id=2820
2018-03-19 15:05:56 +03:00
Leo Yuriev
195b53374e mdbx: fix #pragma pack(pop) balance.
Thanks to <Sergey.V.Barannikov@mcst.ru>.
2018-03-14 16:05:43 +03:00
Leo Yuriev
f521b6615e mdbx: fix #endif's comment (cosmetics). 2018-03-14 15:32:32 +03:00
Leo Yuriev
9bbc62f5a0 mdbx: refine internal warnings control. 2018-03-14 15:16:49 +03:00
Leo Yuriev
8c96b1e73b mdbx: fix missing MDBX_DEVEL=0. 2018-03-14 15:07:16 +03:00
Leo Yuriev
483c4abb3f mdbx: remove Elbrus's alignment_reduction_ignored workaround. 2018-03-14 14:57:46 +03:00
Leo Yuriev
c267a71475 mdbx: workaround for "alignment-reduction-ignored" lcc's bug.
Change-Id: I000bfaffd78ef7b6e27d6178bc2a5defc32cc357
2018-03-07 13:59:51 +03:00
Leo Yuriev
a2099586ed mdbx: disable -Wno-constant-logical-operand inplace.
Change-Id: I0f7745f40e3340ba6d14d985a735777667a7bdde
2018-03-07 13:18:30 +03:00
Leo Yuriev
f76c5188fb mdbx: add stubs for __has_warning and __has_include.
Change-Id: Ic037a38d254e6d986b84a5bfd48106e43cf80320
2018-03-07 13:07:17 +03:00
Leo Yuriev
62603aeadc mdbx: add ifdef-guard for clang < 3.8
Change-Id: Iba7a90e2548056cbdf07ae471eb002da7145821c
2018-03-07 13:06:39 +03:00
Leo Yuriev
62f36ea499 mdbx: bump version to 0.1
Change-Id: I31cdcd598c532d1dd96a4aea961495c838ce0b81
2018-03-07 12:25:35 +03:00
Leo Yuriev
ad4c5d8972 mdbx: add __cold/__hot for Elbrus. 2018-03-07 12:24:32 +03:00
Leo Yuriev
a93fafceff mdbx: strip utf8-bom for Elbrus (minor).
Change-Id: I9030abe267c4abfa2c5c2deb439c0b8025b83047
2018-03-07 12:09:43 +03:00
Leo Yuriev
260c1d71dd mdbx: add self_latter_reader_txnid into MDBX_envinfo.
Change-Id: I17ac6e921f99df6ed61096ff0fbfbacf5a7e4608
2018-02-04 17:13:27 +03:00
Leo Yuriev
72557af2b5 mdbx: HNY!
Change-Id: I2a91b986964d96bb3e5f848e3c17408bd7745866
2018-02-04 13:10:54 +03:00
Leo Yuriev
6a0ff097ee mdbx: immediately share dbi-handles for present TBLs (major).
Change-Id: I75c998e06b3ccc25bd22ef389d119052d524d70b
2018-02-04 12:59:47 +03:00
Leo Yuriev
e8ae506773 mdbx: minor refine env-init. 2018-02-02 19:06:14 +03:00
Leo Yuriev
7b59452aed mdbx: less memset overhead while txn-init. 2018-02-02 19:05:41 +03:00
Leo Yuriev
5db134c816 mdbx: minor refine defs. 2018-02-02 19:04:33 +03:00
Leo Yuriev
5cfec7a832 mdbx: workaround for Windows LockFileEx/WriteFile bug.
This resolves https://github.com/leo-yuriev/libmdbx/issues/25
2018-01-31 15:26:44 +03:00
Leo Yuriev
5c9baa06b9 mdbx: fix mdbx_txn_end() assert for mt_owner. 2018-01-30 19:52:39 +03:00
Leo Yuriev
1143390e58 mdbx: fix/allow mdbx_txn_end() to re-aborting txn. 2018-01-24 18:45:42 +03:00
Leo Yuriev
ca06c1973e mdbx: fix/allow mdbx_txn_renew() after an renew-error. 2018-01-24 17:40:57 +03:00
Leo Yuriev
a45612e6d0 mdbx: fix lower_size overwrite.
Change-Id: If9addb1f549628866e3ce9597f1a542684ef8f2d
2018-01-14 22:40:11 +03:00
Leo Yuriev
ab7cb2c39e mdbx-build: minor cleanup after pul-request/merge.
Change-Id: Ia612dbd939be7acd938fca8eb3f93f650560417a
2018-01-14 22:09:52 +03:00
Leonid Yuriev
506caee9e5
mdbx-buiid: Merge pull request #21 from vvromanov/master
Add CMake build files and rpm generation.
2018-01-14 21:42:34 +03:00
Leonid Yuriev
8d4b6b187f mdbx-windows: resize file on umnap.
Change-Id: Ia4739bfcd2cc7b91c14e294c7569cbee582165b1
2018-01-14 21:16:52 +03:00
Leo Yuriev
5acf93c54d mdbx: rework allowing open large DB from a 32-bit environment.
Change-Id: Id7d9e2041158d0715496b852a5ddb297bde1495e
2018-01-14 21:16:52 +03:00
Leo Yuriev
915830d0d3 mdbx: fix mapsize_min typo inside mdbx_read_header().
Change-Id: I65ffebb37f1332832a0e17796ba184be5d3fc929
2018-01-14 21:16:52 +03:00
Leo Yuriev
c2fe0a71bc mdbx-windows: reserve address space to avoid occupy it by other threads.
Change-Id: Ia5caec6bbeb55c7894de70e349e6e9479572b688
2018-01-14 21:16:52 +03:00
Leonid Yuriev
5c058287d5 mdbx-windows: check ability of address space for growth before umnap.
Change-Id: Ibb62dae26ebab8f3efdbf6aed1b26d88ed63a2b7
2018-01-14 21:16:52 +03:00
Leonid Yuriev
373d4ad81d mdbx: allowing open large DB from a 32-bit environment. 2018-01-14 15:39:11 +03:00
Leo Yuriev
8a08df9188 mdbx: check txn inside mdbx_cursor_renew().
Change-Id: I444ff36739d875dda835e8ded7a7aae37c8bd2be
2018-01-11 21:49:29 +03:00
Leo Yuriev
c4007cbc70 mdbx: check txn inside mdbx_cursor_txn().
Change-Id: Ia3d24800890369e3b6cab23d8f69c27246a4f017
2018-01-11 21:48:47 +03:00
Leo Yuriev
6b5533338f mdbx: prohibit recursive txn-begin by MDBX_BUSY.
Change-Id: I46f5159cec72df9c8aece07fbfb462682499a272
2018-01-11 21:15:33 +03:00
Leo Yuriev
18432ebfab mdbx-windows: minor refine LCK_BODY_LEN.
Change-Id: Id02434a12ba66f15b2aa624819c068f6e6fce0d3
2018-01-10 01:02:23 +03:00
Leo Yuriev
455f60eec1 mdbx: minor fix OSAL (extra assert).
Change-Id: I2caad4a9c4638f124a2bae534bff4d9ed7b57f30
2018-01-10 01:01:49 +03:00
Leo Yuriev
abcacea543 mdbx: more pid and MDBX_FATAL_ERROR checks.
Change-Id: Ifa223f270312cb7bbba01bdb76173f8230efb91b
2018-01-09 21:14:42 +03:00
Leo Yuriev
c0be0d6fb7 mdbx: fix mdbx_env_set_geometry() for case remap failed.
Change-Id: I0850692737eaee3c7f33194dfa19b88ce74497c8
2018-01-09 21:13:04 +03:00
Leo Yuriev
8e8c00aadf mdbx-windows: raise MDBX_PANIC if remap failed. 2018-01-09 15:46:42 +03:00
Leo Yuriev
963da34412 mdbx: fix mdbx_env_set_geometry(). 2018-01-09 15:38:03 +03:00
Leo Yuriev
e7922b65fa mdbx-windows: refine mdbx_mresize(). 2018-01-09 15:37:52 +03:00
Leo Yuriev
59ad929d36 mdbx-windows: fix and refine mdbx_suspend_threads_before_remap().
Change-Id: I4f289f5d603ca18e6714455604dd4ce98931af41
2018-01-08 18:19:25 +03:00
Leo Yuriev
30bd7d3078 mdbx: shrinking memory-mapping for Windows (initial).
Change-Id: I3c3c2df0747c788ea36d7764c1e8139098ca62be
2018-01-08 17:47:41 +03:00
Leo Yuriev
f10f5b376f mdbx: account freelist-backlog while shrinking DB.
Change-Id: I8b211f281483e7cb6344ef99c571f3516d16f61d
2018-01-07 22:31:34 +03:00
Leonid Yuriev
7812476518 mdbx: fix readonly mapping for Windows.
Change-Id: Ie301d7af74ff91e802aa78af8cfb329f587137ee
2018-01-07 17:08:47 +03:00
Vladimir Romanov
4ed8eddf42 Improve cmake support. Add rpm generation 2018-01-07 15:10:06 +03:00
Leonid Yuriev
d14ca5cc4f mdbx: fix _InterlockedExchangeAdd64 for some 32-bit SDKs.
Change-Id: I18280e8ef6432b9db3c5073fd59eaa102462f98d
2018-01-07 14:35:47 +03:00
Leo Yuriev
897d4dbf87 mdbx: fix growth memory-mapping on Windows.
This resolves https://github.com/leo-yuriev/libmdbx/issues/22

Change-Id: I25c2e65d9f68da8012ee097d3ad579cd548f2e09
2018-01-07 14:31:29 +03:00
Leo Yuriev
91a9d4d916 mdbx: more ntpapi for Windows.
Change-Id: I616b09502302be9e3017db7e99cf4dcf8697f32f
2018-01-07 14:22:17 +03:00
Vladimir Romanov
18a261a6dd Add CMake support 2018-01-04 09:27:09 +03:00
Leo Yuriev
24a8bdec49 mdbx: fix SIGSEGV in case mdbx_env_close_ex() called without mdbx_env_open(). 2017-12-20 14:22:55 +03:00
Leo Yuriev
3e9308eb0e mdbx: check for running write-txn inside mdbx_env_close(). 2017-12-19 16:38:21 +03:00
Leo Yuriev
b1c7fa30c0 mdbx: fix MDBX_BUSY comment/description (typo). 2017-12-19 16:37:20 +03:00
Leo Yuriev
96a0647253 mdbx-windows: fix mmap-resize (add MEM_RESERVE afrer NtExtendSection). 2017-12-19 16:07:30 +03:00
Leo Yuriev
8008e23cfa mdbx-windows: minor fix for legacy Windows SDK. 2017-12-19 16:07:25 +03:00
Leo Yuriev
a5b077b2f0 mdbx: minor clarify mdbx_env_set_geometry(). 2017-12-19 15:33:25 +03:00
Leo Yuriev
46a3d4e0a3 mdbx: fix assertion (minor, not a malfunction).
The `env->me_sync_pending` could be zero
when `mdbx_sync_locked()` called from `mdbx_env_set_geometry()`.

Therefore `mdbx_assert(env, !META_IS_STEADY(head) || env->me_sync_pending != 0)` at the top of `mdbx_sync_locked()`
could be trigger assertion failure.
2017-12-18 14:39:41 +03:00
Leo Yuriev
fc1bbf3a4b mdbx: disable 'unreachable code' for MSVC.
Change-Id: I4f9887b557885cb9a3829d19a56d332c76656cf8
2017-10-29 03:23:39 +03:00
Leo Yuriev
866ca18970 mdbx: add few __fallthrough and __unreachable.
Change-Id: Ife18986a3a6391c76f63d12f8102bd6670ae63eb
2017-10-29 02:12:05 +03:00
Leo Yuriev
aec2445161 mdbx: rework '_noop' and related macros.
Change-Id: Ic9ff3662a6abeb64aa0816e448007dd524794b1e
2017-10-29 02:12:05 +03:00
Leo Yuriev
db4ab61a0c mdbx: drop '__packed'.
Change-Id: Idf3e510733adb2b12b94fe1dcd22f76e02df955b
2017-10-29 00:59:11 +03:00
Leo Yuriev
6f6b360aba mdbx: add/fix 'fallthrough' for GCC 7.x
Change-Id: I45c57ea910978aaa857086d7794ad92ba0ae7157
2017-10-28 11:45:04 +03:00
Leo Yuriev
d1f04656ab mdbx: more robustness for thread checking while reset/renew/abort of txn. 2017-10-27 18:01:32 +03:00
Leo Yuriev
d4bf0a3332 mdbx: refine/simplify mdbx_find_oldest().
Simplify b6f14780e381300beaf782fa74252b791aae082e
2017-10-27 15:43:06 +03:00
Leo Yuriev
1a27e40701 mdbx: Merge branch 'fix-after-txntry'. 2017-10-27 14:17:43 +03:00
Leo Yuriev
b6f14780e3 mdbx: fix performance degradation in the absence of readers.
Change-Id: I59a51b61918463e68d3e0490c715f4dcc9ecb788
2017-10-27 13:36:10 +03:00
Leo Yuriev
0a7a290d06 mdbx: drop mdbx_txn_trylock(). 2017-10-26 21:49:39 +03:00
Leo Yuriev
5e1721efdd mdbx: fix mdbx_robust_trylock(). 2017-10-26 21:49:38 +03:00
Leo Yuriev
17b8e48bf4 mdbx: cleanup after last pull-request.
Cleanup after 4e40af60e74143aedaa8d295f0f33a3c892a1c9b (Merge pull request #20 from rouzier/feature/txn_try).
2017-10-26 21:49:38 +03:00
James Rouzier
7c466e53f0 Add the ability to not block when opening a write transaction 2017-10-25 19:41:28 -04:00
Leo Yuriev
4f1c846437 mdbx: rollback to not-a-weak instead to steady. 2017-10-10 18:14:07 +03:00