Леонид Юрьев (Leonid Yuriev)
5afc5c4e8c
mdbx: reorganize/move fences to reduce overhead.
2022-08-07 12:29:51 +03:00
Леонид Юрьев (Leonid Yuriev)
c05a3b7bb9
mdbx: minor refine node_add()
.
2022-08-07 12:29:50 +03:00
Леонид Юрьев (Leonid Yuriev)
1215bda188
mdbx: minor refine/speedup node_del()
.
2022-08-07 12:29:50 +03:00
Леонид Юрьев (Leonid Yuriev)
0dd4532473
mdbx: reduce gap/backlog of linear scan inside dpl_search()
.
2022-08-07 12:29:50 +03:00
Леонид Юрьев (Leonid Yuriev)
eac3d0499f
mdbx: minor refine/speedup dpl_sort_slowpath()
.
2022-08-07 12:29:50 +03:00
Леонид Юрьев (Leonid Yuriev)
a11c045f1e
mdbx: using expect_with_probability()
macro.
2022-08-07 12:28:35 +03:00
Леонид Юрьев (Leonid Yuriev)
8404cc1fd7
mdbx: reduce sorting-network to 8.
2022-08-07 11:56:23 +03:00
Леонид Юрьев (Leonid Yuriev)
654b020bc7
mdbx: add __restrict
to quicksort internal pointers.
2022-08-07 11:56:23 +03:00
Леонид Юрьев (Leonid Yuriev)
77635116c6
mdbx: enable solib profiling with -pg
and gprof
with GLIBC >= 2.37.
...
However such profiling requires https://sourceware.org/bugzilla/show_bug.cgi?id=29438 to be fixed.
2022-08-07 11:56:23 +03:00
Леонид Юрьев (Leonid Yuriev)
d28110373e
mdbx: add simple SORT_CMP_SWAP()
macro for MDBX_HAVE_CMOV=0
case.
2022-08-07 11:56:23 +03:00
Леонид Юрьев (Leonid Yuriev)
480dc2531e
mdbx: ×4 accelerated scan4seq()
(SSE2 only for now).
2022-08-07 11:56:23 +03:00
Леонид Юрьев (Leonid Yuriev)
06734bf8ff
mdbx: don't check owner for finished transactions.
2022-08-06 13:19:49 +03:00
Леонид Юрьев (Leonid Yuriev)
9eb6953778
mdbx: fix minor typo.
2022-08-04 13:54:07 +03:00
Леонид Юрьев (Leonid Yuriev)
268b33cbf7
mdbx: simplify/speedup scan4seq()
.
2022-08-04 13:54:07 +03:00
Леонид Юрьев (Leonid Yuriev)
a441c9ffb1
mdbx: logging pgno of invalid root pages inside meta_checktxnid()
.
2022-08-01 14:44:33 +03:00
Леонид Юрьев (Leonid Yuriev)
71c3d20c01
mdbx: skip extra cycle during search of page sequence.
2022-08-01 00:00:14 +03:00
Леонид Юрьев (Leonid Yuriev)
75d19b5806
mdbx: minor refine/speedup pnl_check()
.
2022-07-27 21:08:54 +03:00
Леонид Юрьев (Leonid Yuriev)
dc39ecfb9f
mdbx: auto-coalesce of GC's records with less overhead.
2022-07-27 21:08:54 +03:00
Леонид Юрьев (Leonid Yuriev)
47d5fa7fd4
mdbx: refine/speedup pnl_merge()
.
2022-07-27 21:08:54 +03:00
Леонид Юрьев (Leonid Yuriev)
262fafd00e
mdbx: fix unused
warning for case MDBX_ENABLE_PGOP_STAT=0
.
2022-07-27 00:03:27 +03:00
Леонид Юрьев (Leonid Yuriev)
289636834c
mdbx: fix unused
warning for case MDBX_DISABLE_VALIDATION
.
2022-07-27 00:03:27 +03:00
Леонид Юрьев (Leonid Yuriev)
c4dd83fbdf
mdbx: minor refine page_split()
.
2022-07-27 00:03:22 +03:00
Леонид Юрьев (Leonid Yuriev)
08e936a809
mdbx: re-verify atomic-ops and remove mo_SequentialConsistency
.
2022-07-23 12:15:19 +03:00
Леонид Юрьев (Leonid Yuriev)
5e565433f7
mdbx: merge branch master
into devel
.
2022-07-23 11:56:17 +03:00
Леонид Юрьев (Leonid Yuriev)
e963375302
mdbx: fix unexpected MDBX_PAGE_FULL
in rare cases with large page-size.
2022-07-21 17:52:08 +03:00
Леонид Юрьев (Leonid Yuriev)
0018164fef
mdbx: fix wrong }
oops-like typo.
...
This is a `devel`-only 3-days old regression since a4a35ce9cb7176b914e0606d38c6d6e47a9431f1.
2022-07-11 20:29:33 +03:00
Леонид Юрьев (Leonid Yuriev)
149e708830
mdbx: rename MDBX_CACHE_METAPTR
build-time option.
2022-07-10 10:05:39 +03:00
Леонид Юрьев (Leonid Yuriev)
194f2f45d2
mdbx: refine/fix using nested cursor's db inside copy-with-compactification.
2022-07-09 18:07:54 +03:00
Леонид Юрьев (Leonid Yuriev)
e8dd208e96
mdbx: more cursor-checking for audit-without-debug.
2022-07-09 16:12:41 +03:00
Леонид Юрьев (Leonid Yuriev)
9108a241a2
mdbx: minor fix/clarify debug logging inside page_alloc_slowpath()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
9aa2aae93e
mdbx: rework/simplify kick_longlived_readers()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
9421bb424d
mdbx: refine/simplify read-latch loop inside mdbx_txn_renew0()
.
...
1. Explicitly check and handle a race/collision case with `find_oldest_reader()`.
2. Handle "recovery mode" (me_stuck_meta >= 0) by the same code as for regular latch.
3. Add bailout error message for buggy compiler and/or hardware (paranoid).
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
434ad8edc8
mdbx: refine bind_rslot()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
a4a35ce9cb
mdbx: rework find_oldest_reader()
.
...
1. Fix regression `assert: oldest >= lck->mti_oldest_reader.weak` after d4bf0a3332c7b05331ab0a87e3cd65b0903edc3c.
2. Add explicit check, kick and notice for stuck reader.
3. Made more e2k-frendly.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
d572052178
mdbx: refine meta_checktxnid()
and meta_waittxnid()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
6f6c581c6e
mdbx: minor refine safe64_write()
, safe64_read()
and safe64_inc()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
baea4c81c9
mdbx: simplify safe64_reset()
.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
ad5a83586b
mdbx: fix insignificant uint8_t
-casting warnings.
2022-07-08 23:44:03 +03:00
Леонид Юрьев (Leonid Yuriev)
db0f4e3d1e
mdbx: minor fix mdbx_page_check()
for case debug-audit enforced.
2022-07-08 21:45:26 +03:00
Леонид Юрьев (Leonid Yuriev)
c499f2bb36
mdbx: minor fix EINVAL
from mdbx_env_set_geometry()
.
...
Silently growth `size_lower` to the `MIN_PAGENO` instead of returning `MDBX_EINVAL`.
2022-07-08 01:14:29 +03:00
Леонид Юрьев (Leonid Yuriev)
6e2a1ebfbd
mdbx: minor fix meta_checktxnid()
to avoid assertion in debug mode.
2022-07-08 01:08:54 +03:00
Леонид Юрьев (Leonid Yuriev)
2cfcfcf91c
mdbx: merge branch erigon
into devel
.
2022-07-07 23:24:45 +03:00
Леонид Юрьев (Leonid Yuriev)
81ea7bd41e
mdbx: fix copy&paste typo inside meta_checktxnid()
.
2022-07-07 21:48:34 +03:00
Леонид Юрьев (Leonid Yuriev)
f16bee8fa1
mdbx: fix/setup zero mod_txnid
during copy-with-compactification.
2022-07-07 21:48:34 +03:00
Леонид Юрьев (Leonid Yuriev)
c95143f41b
mdbx: add poor_page()
.
2022-07-07 21:48:34 +03:00
Леонид Юрьев (Leonid Yuriev)
bc744a843a
mdbx: refine/speedup PAGETYPE()
.
2022-07-07 21:48:34 +03:00
Леонид Юрьев (Leonid Yuriev)
a812198c49
mdbx: rework/clone page_get()
to three for the cases: any, large, branch-leaf.
2022-07-07 21:48:30 +03:00
Леонид Юрьев (Leonid Yuriev)
fbe97a79a3
mdbx: more checking for a large/overflow nodes and pages.
2022-07-07 21:46:19 +03:00
Леонид Юрьев (Leonid Yuriev)
3cc7f105a5
mdbx: fix copy&paste typo inside meta_checktxnid()
.
2022-07-07 19:11:47 +03:00
Леонид Юрьев (Leonid Yuriev)
b31b270ffd
mdbx: refine copy-with-compactification to clear/zero unused gaps on a DB pages.
2022-07-07 19:09:52 +03:00
Леонид Юрьев (Leonid Yuriev)
0b5cdee6ef
mdbx: fix mdbx_env_compact()
hand when DB is corrupted or the volume of an output pages aliquot to MDBX_ENVCOPY_WRITEBUF
.
2022-07-07 19:05:35 +03:00
Леонид Юрьев (Leonid Yuriev)
6eefa05f3d
mdbx: minor refine CC_RETIRING
handling.
2022-07-07 14:10:19 +03:00
Леонид Юрьев (Leonid Yuriev)
ca3f188370
mdbx: extend CHECK_LEAF_TYPE()
by adding CC_OVERFLOW
.
2022-07-07 14:10:19 +03:00
Леонид Юрьев (Leonid Yuriev)
498514dae1
mdbx: remove unneeded CC_COPYING
.
2022-07-07 14:10:19 +03:00
Леонид Юрьев (Leonid Yuriev)
1740f8227a
mdbx: rework copy-with-compactification.
...
Кроме небольшого рефакторинга здесь реализуется более регулярный способ
обхода дерева при копировании с компактификаций. В частности, полная
инициализация курсоров позволяет выполнять больше проверок/контроля
структуры БД и избавиться от флажка CC_COPYING.
Beside a small refactoring, a more regular way of traversing the tree
when copying with compactification is implemented here. In particular,
full initialization of cursors allows to perform more checks/control of
the DB structure and get rid of the CC_COPYING flag.
2022-07-07 14:10:19 +03:00
Леонид Юрьев (Leonid Yuriev)
2d300d807b
mdbx: extract node_read_bigdata()
.
2022-07-07 14:10:19 +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)
6c5ff863ff
mdbx: remove pp_txnid4chk()
, preparing to rework of page checking/validation.
2022-07-05 15:32:09 +03:00
Леонид Юрьев (Leonid Yuriev)
d61c096313
mdbx: drop mdbx_recent_steady_txnid()
and fix extra search for steady meta-page.
2022-07-02 22:53:48 +03:00
Леонид Юрьев (Leonid Yuriev)
b9835389f4
mdbx: add cache for pointers to last/steady meta-pages (off by default).
2022-07-02 22:52:31 +03:00
Леонид Юрьев (Leonid Yuriev)
720b4d56be
mdbx: bigfoot feature.
...
Chunking long list of retired pages during huge transactions commit
to avoid use sequences of pages:
- splits a long retired page-number-list into chunks
which fits one per single overflow/large page;
- this requires a few unique id for keys
for create such records into GC/freeDB;
- just use the necessary subsequent IDs following the current
transaction ID and then take the last of ones to update a meta-page.
Thus avoids using/allocating/searching a sequence of free pages
but just increase txnid more than one during the commit
a huge write transaction with a long retired-pages-list.
2022-07-02 22:33:25 +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)
48c6051482
mdbx: minor fix meta_checktxnid()
to avoid assertion in debug mode.
2022-06-29 13:37:26 +03:00
Леонид Юрьев (Leonid Yuriev)
23bbceb367
mdbx: minor fix EINVAL
from mdbx_env_set_geometry()
.
...
Silently growth `size_lower` to the `MIN_PAGENO` instead of returning `MDBX_EINVAL`.
2022-06-27 13:55:44 +03:00
Леонид Юрьев (Leonid Yuriev)
065e5849da
mdbx: speedup GC-related pnl-merge and sequence-search.
2022-06-27 12:37:29 +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)
ece2fe2514
mdbx: split page_alloc()
and page_new()
to fast- and slow/rare- parts.
2022-06-27 12:37:29 +03:00
Леонид Юрьев (Leonid Yuriev)
f1ccc717b4
mdbx: add update-gc context (extracted from bigfoot
).
2022-06-27 11:27:05 +03:00
Леонид Юрьев (Leonid Yuriev)
3817236b68
mdbx: avoid memory-model from variables for C11 atomics (workaround for lcc 1.26).
2022-06-12 20:04:35 +03:00
Леонид Юрьев (Leonid Yuriev)
c082eb7d8a
mdbx: use _tlv_atexit()
on Darwin/MacOSX.
2022-06-11 21:16:29 +03:00
Леонид Юрьев (Leonid Yuriev)
abac366eac
mdbx: rework/fix rthc-cleanup using pthread' tsd to avoid write-after-free (critical).
2022-06-11 21:16:29 +03:00
Леонид Юрьев (Leonid Yuriev)
63f8eb253d
mdbx: do not enable ASAN.detect_leaks in macOS since unsupported.
2022-06-10 17:26:10 +03:00
Леонид Юрьев (Leonid Yuriev)
117be44c44
mdbx: fix nasty typename typo.
...
Спасибо Станиславу Очеретному за сообщение о проблеме.
2022-06-08 20:57:42 +03:00
Леонид Юрьев (Leonid Yuriev)
cdb16c9f00
mdbx: minor fix/clarify internal comment.
2022-06-07 18:13:49 +03:00
Леонид Юрьев (Leonid Yuriev)
d1e67645a2
mdbx: refine handling EACCESS
while trying create LCK-file on a read-only filesystem.
2022-06-04 02:04:55 +03:00
Леонид Юрьев (Leonid Yuriev)
a4da10bc62
mdbx: minor fix LCK-initialization.
2022-06-03 22:40:18 +03:00
Леонид Юрьев (Leonid Yuriev)
e795fe7c3e
mdbx: fix without-LCK (exclusive + readonly) mode.
2022-06-03 22:39:11 +03:00
Леонид Юрьев (Leonid Yuriev)
d9407ee648
mdbx: minor refine page_alloc()
internal logging.
2022-05-31 17:48:23 +03:00
Леонид Юрьев (Leonid Yuriev)
c7bde8be8d
mdbx: rework internal DBI-handles serials, validation and import into a txn (squashed).
2022-05-31 17:48:10 +03:00
Леонид Юрьев (Leonid Yuriev)
21e1dc3248
mdbx: fix minor warnings from modern Apple's CLANG.
2022-05-15 23:42:57 +03:00
Леонид Юрьев (Leonid Yuriev)
5cd4190f2d
mdbx: fix copy&paste bug.
...
Resolves https://gitflic.ru/project/erthink/libmdbx/issue/5
2022-05-12 14:21:19 +03:00
Леонид Юрьев (Leonid Yuriev)
405de05ca9
mdbx: return MDBX_RESULT_TRUE
on empty transaction commit.
2022-05-12 13:11:59 +03:00
Леонид Юрьев (Leonid Yuriev)
548d0a50b8
mdbx: minor refine logging inside page_alloc()
.
2022-05-04 19:07:33 +03:00
Леонид Юрьев (Leonid Yuriev)
f57ca4fbf6
mdbx: minor refine logging inside fetch_sdb()
.
2022-05-04 18:00:54 +03:00
Леонид Юрьев (Leonid Yuriev)
838f8d8fab
mdbx: move most of transactions flags to public API.
2022-05-03 11:49:28 +03:00
Леонид Юрьев (Leonid Yuriev)
447d6bfca5
mdbx: add logging to mdbx_fetch_sdb()
to help users debugging complex DBI use cases.
2022-05-01 12:02:40 +03:00
Леонид Юрьев (Leonid Yuriev)
bb377fd20e
mdbx: merge branch master
into devel
.
2022-04-21 15:44:23 +03:00
Леонид Юрьев (Leonid Yuriev)
a2aa6667e1
mdbx: avoid 32-bit Bionic/Android hang within pthread_mutex_lock()
.
2022-04-21 15:41:25 +03:00
Леонид Юрьев (Leonid Yuriev)
6d15836171
mdbx: use todo4recovery://erased_by_github/
for dead (or temporarily lost) resources.
2022-04-21 15:34:53 +03:00
Леонид Юрьев (Leonid Yuriev)
ed23956e11
mdbx: basic cleanup from dead github and another corrupted services.
2022-04-20 06:42:16 +03:00
Леонид Юрьев (Leonid Yuriev)
9fa4e21165
mdbx: fix assertion regression.
...
Fixes https://github.com/ledgerwatch/erigon/issues/3874 .
This was a minor regression after the c4a5325aafd3f03ce7520731b9da7253d7d178f0
that affects only debug builgs (with enabled assertions) and only when the added
code catch a incoherency of unified page/buffer cache.
2022-04-11 21:52:46 +03:00
Leonid Yuriev
21da42d23d
mdbx: fix built-in status of MDBX_WITHOUT_MSVC_CRT
option.
2022-03-30 18:10:03 +03:00
Леонид Юрьев (Leonid Yuriev)
2497437060
mdbx: mark the parent transaction dirty in case the undo of the geometry update failed during abortion of a nested transaction.
2022-03-29 18:57:35 +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)
6380f2e844
mdbx: minor reformat (cosmetics).
2022-03-25 13:47:37 +03:00
Леонид Юрьев (Leonid Yuriev)
fef90d2a3c
mdbx: add explicit memset()
for debugging.
2022-03-25 13:47:37 +03:00
Леонид Юрьев (Leonid Yuriev)
d522069080
mdbx: fix rare SIGSEGV in cursor tracking code.
...
The error was that the array of pointers in the transaction zeroed by the
value of env->me_numdbs and before txn->mt_numdbs was set to env->me_numdbs.
Thus, a cursor pointer(s) in the starting transaction could uninitialized if
another thread opened a dbi-handle(s) between the two aforementioned events.
2022-03-25 13:05:46 +03:00
Леонид Юрьев (Leonid Yuriev)
43070c7b26
mdbx: minor fix meta_checktxnid()
for Valgrind/ASAN usage.
...
Related to https://github.com/erthink/libmdbx/issues/269 .
2022-03-24 12:11:50 +03:00
Леонид Юрьев (Leonid Yuriev)
45f8197635
mdbx: clarify/refine error messages of a signature/version mismatch.
2022-03-24 00:19:34 +03:00
Леонид Юрьев (Leonid Yuriev)
b79f6712e3
mdbx: refine override_meta()
to preserve format-signature for legacy/zero mod_txnid.
2022-03-23 00:48:41 +03:00