Skip to content

Commit ed651b8

Browse files
committed
mdbx: add mdbx_txn_gc_info().
1 parent 088e175 commit ed651b8

File tree

14 files changed

+488
-275
lines changed

14 files changed

+488
-275
lines changed

ChangeLog.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,58 @@ BTC `bc1qzvl9uegf2ea6cwlytnanrscyv8snwsvrc0xfsu`, SOL `FTCTgbHajoLVZGr8aEFWMzx3N
427427

428428
********************************************************************************
429429

430+
## v0.13.11 "A7A5" (just as Stable) at 2026-01-30
431+
432+
The supporting release of a stable branch with bug fixes.
433+
434+
Appreciations:
435+
436+
- [Erigon](https://erigon.tech/) for sponsorship.
437+
- [Cosmin Apreutesei](https://github.com/capr) for bug reporting.
438+
- [Igor Ikonopistsev](https://github.com/ikonopistsev) for [NodeJS bindings](https://github.com/ikonopistsev/mdbxmou).
439+
- Anatoly Zhmur for reporting bugs.
440+
441+
Important:
442+
443+
- _libmdbx_ project has changed its code development and distribution model.
444+
**To get acquainted with important changes and plans, we recommend reading the compact [presentation "libmdbx: successes, obstacles, goals and roadmap"](https://libmdbx.dqdkfa.ru/release/libmdbx-roadmap-HNY2026-english.pdf), which contains important explanations in the form of embedded comments.**
445+
446+
- At a many requests of users, the change log now is kept in English.
447+
448+
Fixes:
449+
450+
- Fixed using of the identifier `ERROR_UNHANDLED_ERROR`, which is not defined in new versions of Windows SDK.
451+
452+
- Fixed non-closing of DBI descriptors for tables created in nested transactions when such transactions are aborted.
453+
454+
- Fixed MSVC warning C4324 for `buffer::silo::bin`.
455+
456+
- Added workaround for MinGW build failures of dll-enabled C++ API.
457+
458+
- Fixed extra msync/fsync operations during GC reclaiming in a full database.
459+
460+
- Fixed suboptimal reducing/merging of histogram items in an output of the `mdbx_chk` tool.
461+
462+
- Added backlog-adjustment trick to avoid extra-growth of DB instead of reclaim GC in a rare specific cases.
463+
In the 0.14.x version series, this mechanism has been completely updated.
464+
However, for version 0.13.11, this inelegant modification done in order to reduce the risk of regression.
465+
466+
- Minor fixed `iov_callback4dirtypages()` and assertion inside `cursor_put()` to avoid Valgrind/ASAN warnings.
467+
468+
- Fixed cursor(s) finalization after ones explicitly closed in a nested transactions.
469+
470+
Other:
471+
472+
- Clarification and addition of documentation.
473+
474+
- Considering extended ASCII as non-printable if UTF8 enabled in C++ API.
475+
476+
- Using hex dump of `mdbx::slice` instead of base58 in C++ API.
477+
478+
- Added link to [`mdbxmou`](https://github.com/ikonopistsev/mdbxmou) bindings for NodeJS.
479+
480+
--------------------------------------------------------------------------------
481+
430482
## v0.13.10 "Блеск Славы" (Gloss of Glory) от 2025-12-17
431483

432484
Поддерживающий выпуск стабильной ветки с исправлением обнаруженных ошибок и устранением недочётов,

VERSION.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "git_describe": "v0.14.1-376-ge2ab238f", "git_timestamp": "2026-02-02T22:29:25+03:00", "git_tree": "7543b751d370647a1b4c8b306dd9fde120b64c9c", "git_commit": "e2ab238f6a7bbe0e2f2face9e57b46edae0cbc50", "semver": "0.14.1.376" }
1+
{ "git_describe": "v0.14.1-388-g6758fda6", "git_timestamp": "2026-02-05T14:03:41+03:00", "git_tree": "32bd099045868b55948d521d0c9853fc3a197001", "git_commit": "6758fda69241fd53c8eaa0753af67dec2defd97c", "semver": "0.14.1.388" }

config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.1-376-ge2ab238f at 2026-02-02T22:29:25+03:00),
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.1-388-g6758fda6 at 2026-02-05T14:03:41+03:00),
22
* it is the template for libmdbx's config.h
33
******************************************************************************/
44

mdbx-internals.h

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.1-376-ge2ab238f at 2026-02-02T22:29:25+03:00).
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.1-388-g6758fda6 at 2026-02-05T14:03:41+03:00).
22
*
33
* libmdbx (aka MDBX) is an extremely fast, compact, powerful, embeddedable, transactional key-value storage engine with
44
* open-source code. MDBX has a specific set of properties and capabilities, focused on creating unique lightweight
@@ -24,7 +24,7 @@
2424

2525
#define xMDBX_ALLOY 1 /* alloyed build */
2626

27-
#define MDBX_BUILD_SOURCERY d24f435602246a5fa75b5957b2fce033f79ccc0e1fa6c99d121d838ffcb256ce_v0_14_1_376_ge2ab238f
27+
#define MDBX_BUILD_SOURCERY 69dea242ab8900cb9d5797013acb37f36ab44327cb53f54c75ab4b152bdad13b_v0_14_1_388_g6758fda6
2828

2929
#define LIBMDBX_INTERNALS
3030
#define MDBX_DEPRECATED
@@ -2396,11 +2396,7 @@ typedef struct geo {
23962396
pgno_t now; /* current size of datafile in pages */
23972397
pgno_t end_pgno;
23982398
};
2399-
union {
2400-
pgno_t first_unallocated; /* first unused page in the datafile,
2401-
but actually the file may be shorter. */
2402-
pgno_t next_pgno;
2403-
};
2399+
pgno_t first_unallocated; /* first unused page in the datafile. */
24042400
} geo_t;
24052401

24062402
/* Meta page content.
@@ -3328,9 +3324,11 @@ typedef const pgno_t *const_pnl_t;
33283324
#define MDBX_PNL_GRANULATE (1 << MDBX_PNL_GRANULATE_LOG2)
33293325
#define MDBX_PNL_INITIAL (MDBX_PNL_GRANULATE - 2 - MDBX_ASSUME_MALLOC_OVERHEAD / sizeof(pgno_t))
33303326

3331-
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline size_t pnl_alloclen(const_pnl_t pnl) { return pnl[-1]; }
3327+
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline size_t pnl_alloclen(const const_pnl_t pnl) {
3328+
return pnl[-1];
3329+
}
33323330

3333-
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline size_t pnl_size(const_pnl_t pnl) { return pnl[0]; }
3331+
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline size_t pnl_size(const const_pnl_t pnl) { return pnl[0]; }
33343332

33353333
MDBX_MAYBE_UNUSED static inline void pnl_setsize(pnl_t pnl, size_t len) {
33363334
assert(len < INT_MAX);
@@ -3370,7 +3368,7 @@ MDBX_INTERNAL pnl_t pnl_alloc(size_t size);
33703368

33713369
MDBX_INTERNAL void pnl_free(pnl_t pnl);
33723370

3373-
MDBX_MAYBE_UNUSED MDBX_INTERNAL pnl_t pnl_clone(const pnl_t src);
3371+
MDBX_MAYBE_UNUSED MDBX_INTERNAL pnl_t pnl_clone(const const_pnl_t src);
33743372

33753373
MDBX_INTERNAL int pnl_reserve(pnl_t __restrict *__restrict ppnl, const size_t wanna);
33763374

@@ -3406,7 +3404,7 @@ MDBX_INTERNAL int __must_check_result pnl_append_span(__restrict pnl_t *ppnl, pg
34063404

34073405
MDBX_INTERNAL int __must_check_result pnl_insert_span(__restrict pnl_t *ppnl, pgno_t pgno, size_t n);
34083406

3409-
MDBX_NOTHROW_PURE_FUNCTION MDBX_INTERNAL size_t pnl_search_nochk(const pnl_t pnl, pgno_t pgno);
3407+
MDBX_NOTHROW_PURE_FUNCTION MDBX_INTERNAL size_t pnl_search_nochk(const const_pnl_t pnl, pgno_t pgno);
34103408

34113409
MDBX_INTERNAL void pnl_sort_nochk(pnl_t pnl);
34123410

@@ -3422,7 +3420,7 @@ MDBX_MAYBE_UNUSED static inline void pnl_sort(pnl_t pnl, size_t limit4check) {
34223420
(void)limit4check;
34233421
}
34243422

3425-
MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline size_t pnl_search(const pnl_t pnl, pgno_t pgno,
3423+
MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline size_t pnl_search(const const_pnl_t pnl, pgno_t pgno,
34263424
size_t limit) {
34273425
assert(pnl_check_allocated(pnl, limit));
34283426
if (MDBX_HAVE_CMOV) {
@@ -3440,9 +3438,9 @@ MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline size_t pnl_search(con
34403438
return n;
34413439
}
34423440

3443-
MDBX_INTERNAL size_t pnl_merge(pnl_t dst, const pnl_t src);
3441+
MDBX_INTERNAL size_t pnl_merge(pnl_t dst, const const_pnl_t src);
34443442

3445-
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION MDBX_INTERNAL size_t pnl_maxspan(const pnl_t pnl);
3443+
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION MDBX_INTERNAL size_t pnl_maxspan(const const_pnl_t pnl);
34463444

34473445
#endif /* !__cplusplus */
34483446

@@ -3456,21 +3454,3 @@ extern LIBMDBX_API const char *const mdbx_sourcery_anchor;
34563454
#endif
34573455

34583456
#define MDBX_IS_ERROR(rc) ((rc) != MDBX_RESULT_TRUE && (rc) != MDBX_RESULT_FALSE)
3459-
3460-
/*----------------------------------------------------------------------------*/
3461-
3462-
MDBX_NOTHROW_CONST_FUNCTION MDBX_MAYBE_UNUSED static inline pgno_t int64pgno(int64_t i64) {
3463-
if (likely(i64 >= (int64_t)MIN_PAGENO && i64 <= (int64_t)MAX_PAGENO + 1))
3464-
return (pgno_t)i64;
3465-
return (i64 < (int64_t)MIN_PAGENO) ? MIN_PAGENO : MAX_PAGENO;
3466-
}
3467-
3468-
MDBX_NOTHROW_CONST_FUNCTION MDBX_MAYBE_UNUSED static inline pgno_t pgno_add(size_t base, size_t augend) {
3469-
assert(base <= MAX_PAGENO + 1 && augend < MAX_PAGENO);
3470-
return int64pgno((int64_t)base + (int64_t)augend);
3471-
}
3472-
3473-
MDBX_NOTHROW_CONST_FUNCTION MDBX_MAYBE_UNUSED static inline pgno_t pgno_sub(size_t base, size_t subtrahend) {
3474-
assert(base >= MIN_PAGENO && base <= MAX_PAGENO + 1 && subtrahend < MAX_PAGENO);
3475-
return int64pgno((int64_t)base - (int64_t)subtrahend);
3476-
}

0 commit comments

Comments
 (0)