Commit Graph

4897 Commits

Author SHA1 Message Date
Леонид Юрьев (Leonid Yuriev)
65184ff73b mdbx: rework/refine chk reporting tree/pages/tables information (squashed). 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
b8f4d6ccdd mdbx: rename "other" pages to "broken" in chk-output. 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
c466dea250 mdbx: clean library core from using a float-point. 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
1cf65cd880 mdbx: refine handling the MDBX_WITHOUT_MSVC_CRT option. 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
7e43e14c7b mdbx: more info-output from mdbx_env_chk().
Print system io-block size, unified-page-cache block size, space allocated for the dxb-file in a filesystem.
2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
410bbbd9a5 mdbx: extending MDBX_envinfo. 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
06b6739e68 mdbx: fix assertion inside gc_alloc_ex(). 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
045968b46a mdbx: fix txn_basis_snapshot(). 2025-11-05 01:20:09 +03:00
Леонид Юрьев (Leonid Yuriev)
e292e8178c mdbx: update ChangeLog. 2025-10-29 00:14:26 +03:00
Леонид Юрьев (Leonid Yuriev)
60d5ba9790 mdbx: minor workaround for HarmonyOS's bug.
The libc from HarmonyOS SDK erroneously defines `EOWNERDEAD`,
`_POSIX_THREAD_PROCESS_SHARED >= 200809` and `PTHREAD_MUTEX_ROBUST` but
the same time doesn't provide `pthread_mutexattr_setrobust()` and
`pthread_mutex_consistent()`.

This commit add a minor workaround for such bug for successful building
without explicitly defining `MDBX_LOCKING=2001`.

Related to https://github.com/erthink/libmdbx/issues/285, https://github.com/vorot93/libmdbx-rs/issues/41, https://github.com/isar-community/isar-community/issues/28.
2025-10-29 00:10:06 +03:00
Leonid Yuriev
43c4503a77 mdbx: minor clean-up tautology in assertion. 2025-10-26 18:02:04 +03:00
Leonid Yuriev
aafe0f0fba mdbx: use Windows10 SDK by default. 2025-10-26 18:02:04 +03:00
Леонид Юрьев (Leonid Yuriev)
dc5f119de1 mdbx-cmake: support of MDBX_USE_FALLOCATE for CMake and Conan. 2025-10-20 12:52:36 +03:00
Леонид Юрьев (Leonid Yuriev)
a14fe7f195 mdbx: append TODO. 2025-10-20 12:17:46 +03:00
Леонид Юрьев (Leonid Yuriev)
4d6eb8a959 mdbx: update ChangeLog. 2025-10-18 12:36:36 +03:00
Леонид Юрьев (Leonid Yuriev)
2b0bfb9eea mdbx: revert/drop MDBX_DBG_NOFALLOC_INCORE and introduce osal_fsetsize().
This fixes regression after the 2a7f460345 as when
a DXB file remains longer than necessary on Mac or Linux when building without `_GNU_SOURCE`.
2025-10-18 12:36:29 +03:00
Леонид Юрьев (Leonid Yuriev)
5f2f5f34e0 mdbx-tests: fix minor typo in the battery-tmux script. 2025-10-17 14:31:17 +03:00
Леонид Юрьев (Leonid Yuriev)
a52fba9dbc mdbx: update ChangeLog. 2025-10-10 09:47:23 +03:00
Леонид Юрьев (Leonid Yuriev)
ee6a045f17 mdbx: add MDBX_DBG_NOFALLOC_INCORE.
It is a workaround to sporadic test failures due to lack of space in tmpfs and/or free memory.
2025-10-09 23:26:18 +03:00
Леонид Юрьев (Leonid Yuriev)
ed2cb62f39 mdbx-doc: refine doxygen comments for enum MDBX_debug_flags_t. 2025-10-09 23:26:18 +03:00
Леонид Юрьев (Leonid Yuriev)
924581bdc8 mdbx: merge-in ChangeLog from the stable/0.13.x branch. 2025-09-18 09:21:46 +03:00
Stefan de Konink
19db693d00 Doc: add difference between mdbx_dbi_open and mdbx_dbi_open2 2025-09-16 13:42:59 +03:00
Леонид Юрьев (Leonid Yuriev)
48c3805a96 mdbx: update TODO. 2025-09-12 12:49:54 +03:00
Леонид Юрьев (Leonid Yuriev)
07b07e19b3 mdbx: update ChangeLog. 2025-09-11 20:16:08 +03:00
Леонид Юрьев (Leonid Yuriev)
bdbbf3db68 mdbx: fix rare/specific unexpected assertion failure bmi > 0 on 32-bit debug builds. 2025-09-11 19:06:14 +03:00
Леонид Юрьев (Leonid Yuriev)
f2a5ca26a6 mdbx: using atomic_yield() inside safe64_read() retry loop. 2025-09-09 22:26:40 +03:00
Леонид Юрьев (Leonid Yuriev)
4adba731f5 mdbx: introduce internal lck_setlk_with3retries() as workaround EAGAIN on Android. 2025-09-08 10:46:30 +03:00
Леонид Юрьев (Leonid Yuriev)
71f42a77d5 mdbx-cmake: fix/refactoring search for lib.exe/dlltool.exe. 2025-09-08 10:32:17 +03:00
Леонид Юрьев (Leonid Yuriev)
815d483803 mdbx: extract internal osal_yield(). 2025-09-08 10:32:17 +03:00
Леонид Юрьев (Leonid Yuriev)
74ef6502e3 mdbx-windows: move the LockFileEx(LOCKFILE_FAIL_IMMEDIATELY) repeats for using in all cases. 2025-09-07 13:33:13 +03:00
Леонид Юрьев (Leonid Yuriev)
cd27aa017f mdbx: add internal txn_basis_snapshot(). 2025-09-07 00:28:58 +03:00
Леонид Юрьев (Leonid Yuriev)
fc4c02511d mdbx-doc: clarify description of mdbx_dbi_sequence(). 2025-09-07 00:28:29 +03:00
Леонид Юрьев (Leonid Yuriev)
222d8f13f8 mdbx: extract internal check_key(). 2025-09-07 00:28:29 +03:00
Леонид Юрьев (Leonid Yuriev)
d7e3c2a0fc mdbx: add internal ptr2page(). 2025-09-07 00:28:22 +03:00
Леонид Юрьев (Leonid Yuriev)
eee21feba7 mdbx: rename internal page2payload() and payload2page(). 2025-09-07 00:28:02 +03:00
Леонид Юрьев (Leonid Yuriev)
9ad4fe8f96 mdbx: refine ceil/rounding to be perfectly close to system allocation granularity. 2025-09-03 22:50:29 +03:00
Леонид Юрьев (Leonid Yuriev)
9c0886972d mdbx: alter the globals.sys_allocation_granularity guessing. 2025-09-03 21:38:05 +03:00
Леонид Юрьев (Leonid Yuriev)
26d5ef6b2d mdbx: add xyz_ceil2ag_xyz(), i.e. ceiling to system allocation granularity. 2025-09-03 21:38:05 +03:00
Леонид Юрьев (Leonid Yuriev)
41abfffeb3 mdbx: rename xyz_align2os_xyz() to xyz_ceil2sp_xyz() (cosmetics). 2025-09-03 20:18:41 +03:00
Леонид Юрьев (Leonid Yuriev)
c97a31b47b mdbx: fix inappropriate/irrelevant MDBX_WANNA_RECOVERY when the DB size is not rounded to sys-allocation-granularity (imported from the stable branch).
For now this is just the patch that eliminates regression by making the
least risky/invasive changes. However a complete fix involves refining
the rounding of a database size, which still is to do.

The check corrected by this commit was never fundamentally important,
but it was added to verify the logic of rounding the database size in
various cases.
However, after the commit `2a7f460345edbeb26a51782cbe6af3c55254ae77`
(using `fallocate()` to prevent `SIGBUS`), the behavior change led to
the returning error `MDBX_WANNA_RECOVERY` in fairly harmless conditions.
2025-08-29 13:18:10 +03:00
Леонид Юрьев (Leonid Yuriev)
58dc772a27 mdbx-tests: fix silently/unclear failures of stochastic test due an errors from mdbx_chk (imported from the stable branch). 2025-08-29 12:34:16 +03:00
Леонид Юрьев (Leonid Yuriev)
d6f6579401 mdbx: update ChangeLog. 2025-08-24 10:49:28 +03:00
Леонид Юрьев (Leonid Yuriev)
e03f16999c mdbx: cleanup extra changes after the 5c6d91f7c. 2025-08-24 09:34:42 +03:00
Леонид Юрьев (Leonid Yuriev)
109858b994 mdbx-test: workaround for the ENOSPC from a tmpfs. 2025-08-24 09:34:42 +03:00
Леонид Юрьев (Leonid Yuriev)
466062151f mdbx: cleanup redundant MDBX_INTERNAL. 2025-08-24 09:34:42 +03:00
Леонид Юрьев (Leonid Yuriev)
2a7f460345 mdbx: fix unexpected SIGBUS is not enough space in a filesystem.
On a modern Linux the allocation of space for a file can be deferred
and/or lazy, rather than when setting its length using `ftruncate()`.
The actual allocation of space occurs when writing to the corresponding
areas of the file, or when reading ones (in this case, the file system
fills these areas with zeros).

The specific behavior depends on the type of file system and the kernel
version, but the main thing is that possibilities currently are, when
setting the file size, just the instantaneous ability to allocate space
is checked, without any booking.

If the file system is running out of space, an `ENOSPC` error may occur
when processing (inside a OS kernel) a page fault when accessing one of
the added pages after the database has been enlarged. In this case, the
OS kernel has no other alternative but to send a `SIGBUS` signal to the
process.

This commit fixes the problem by adding the use of system calls to
explicitly allocate space for a given file size.
Related-to https://github.com/erigontech/erigon/issues/16709

This is a simple improvement, however which is complicated by the need
to take into account the availability of the appropriate system API and
handle non-fatal errors from file systems that do not support the
appropriate operations. Therefore, there is a risk of regressions in
unusual/rare situations, including when hosting databases on network
media.
2025-08-22 13:46:49 +03:00
Леонид Юрьев (Leonid Yuriev)
f23a72f59c mdbx: update ChangeLog. 2025-08-05 13:33:47 +03:00
Леонид Юрьев (Leonid Yuriev)
43be7b05a7 mdbx: enabling older Linux kernels starting from 3.16 2025-08-05 12:44:13 +03:00
Леонид Юрьев (Leonid Yuriev)
289276f13c mdbx: merge-in ChangeLog from the stable/0.13.x branch. 2025-08-04 00:08:42 +03:00
Леонид Юрьев (Leonid Yuriev)
16f41ffcd1 mdbx: patch update for older versions of buildroot. 2025-08-04 00:07:34 +03:00