И еще в пишущем потоке вызывается int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno,
Что захватывает лок в эксклюзивном режиме:
mdbx_srwlock_AcquireExclusive(&env->me_remap_guard);
libmdbx (2021-06-08 ... 2022-05-10)
Assertion failed: (!"Invalid data-size"), function mdbx_cursor_put, file mdbx, line 14385.
return MDBX_BAD_VALSIZE;
.mdbx_limits_valsize_max()
devel
на github.MDBX_NOTLS
:NtExtendSection()
только наращивать размер БД в пределах изначально заказанной геометрии.NtExtendSection()
.
libmdbx
from python.master
branch until the TODO list is empty (at least mostly).libmdbx.so
.libmdbx.so
.
---- execution stage --\ /--\
\--block--\ /-\ /---/ \- block
\--eth tx--/ \--eth tx--/
Sum0..M(Olog(Nm))
Sum1..M(Nm*Olog(Nm))
M
- количество уровней вложенности, а Nm
- количество dirty/spilled/retired страниц на m
-ом уровне вложенности.MDBX_NOTLS
option. · Issue #203 · erthink/libmdbx). Работает
__cplusplus
.<version>
.__has_include()
.<version>
из MSVC.
/Zc:__cplusplus
SUBPROJECT`в что-то вроде `SUBDIR
).
/Zc:__cplusplus
при сборке MDBX, т.к. совсем не очевидная ошибка вылатает
MDBX_NOTLS
option)?
indx_t mp_ptrs[]this contains all the pointers to the MDBX_node correct?
64bit_value & 0xFFFFFFFFFFFF, in MDBX page_ptrs 32bit correct? do I need to mask it the same way to find
page_ptrand whats the mask value if any?
mdbx.dat
file and trying to traverse the tree, so I can better understand the structure and details
return (pgno_t)(bytes >> env->me_psize2log);
bytes
is an offset inside DB file and/or mapping, then the bytes >> env->me_psize2log
is a corresponding DB page number.psize2logis
log2(pageSize)correct?
struct MDBX_db
.
sizeof(pgno_t)
are page number
ioarena
bench, and lmdb and rocksdb finish in a few seconds, but mdbx is going for ages. I am using the defaults - 1M operations, 16 byte key, 32 byte value. The mdbx engine caps at 166 set requests per second, which is quite slow. Am I doing something wrong?
IOARENA (embedded storage benchmarking)
configuration:
engine = mdbx
datadir = ./_ioarena
benchmark = set, get
durability = lazy
wal = indef
operations = 1000000
key size = 16
value size = 32
binary = no
continuous = no
key-gen: using 24 bits, up to 1000000 keys
doer.0: {set, get}, key-space 0, key-sequence 0
time | bench rps min avg rms max vol #N | bench rps min avg rms max vol #N
1.013 | set: 43.326K 320.000ns 22.832us 383.898us 13.226ms 2.080Mbps 43.901K | get - - - - - - -
2.021 | set: 171.708 2.423ms 5.820ms 6.096ms 12.861ms 8.242Kbps 44.074K | get - - - - - - -
3.027 | set: 152.029 1.894ms 6.574ms 7.026ms 15.937ms 7.297Kbps 44.227K | get - - - - - - -
4.028 | set: 161.890 2.102ms 6.173ms 6.607ms 19.476ms 7.771Kbps 44.389K | get - - - - - - -
5.029 | set: 160.858 3.838ms 6.213ms 6.551ms 19.244ms 7.721Kbps 44.550K | get - - - - - - -
6.031 | set: 168.611 2.483ms 5.927ms 6.272ms 18.173ms 8.093Kbps 44.719K | get - - - - - - -
7.033 | set: 173.704 2.350ms 5.753ms 5.991ms 12.194ms 8.338Kbps 44.893K | get - - - - - - -
8.036 | set: 158.412 2.120ms 6.308ms 6.794ms 20.175ms 7.604Kbps 45.052K | get - - - - - - -
9.041 | set: 147.356 3.490ms 6.783ms 7.166ms 14.143ms 7.073Kbps 45.200K | get - - - - - - -
10.046 | set: 170.121 3.426ms 5.876ms 6.349ms 20.710ms 8.166Kbps 45.371K | get - - - - - - -
11.050 | set: 177.379 2.247ms 5.635ms 5.957ms 16.931ms 8.514Kbps 45.549K | get - - - - - - -
12.061 | set: 171.976 1.877ms 5.813ms 6.158ms 15.371ms 8.255Kbps 45.723K | get - - - - - - -
13.070 | set: 168.557 3.497ms 5.930ms 6.236ms 15.038ms 8.091Kbps 45.893K | get - - - - - - -
14.071 | set: 162.772 3.579ms 6.140ms 6.445ms 19.071ms 7.813Kbps 46.056K | get - - - - - - -
15.084 | set: 170.823 2.962ms 5.850ms 6.168ms 14.239ms 8.199Kbps 46.229K | get - - - - - - -
16.091 | set: 172.821 2.097ms 5.783ms 6.159ms 15.177ms 8.295Kbps 46.403K | get - - - - - - -
17.100 | set: 161.474 3.518ms 6.189ms 6.453ms 15.083ms 7.751Kbps 46.566K | get - - - - - - -
18.108 | set: 165.651 3.503ms 6.033ms 6.308ms 13.021ms 7.951Kbps 46.733K | get - - - - - - -
19.116 | set: 171.631 2.364ms 5.823ms 6.097ms 13.350ms 8.238Kbps 46.906K | get - - - - - - -
20.117 | set: 171.853 1.796ms 5.816ms 6.169ms 12.736ms 8.249Kbps 47.078K | get - - - - - - -
21.120 | set: 158.628 3.835ms 6.300ms 6.642ms 18.696ms 7.614Kbps 47.237K | get - - - - - - -
key-gen: using 24 bits, up to 1000000 keys
doer.0: {set, get}, key-space 0, key-sequence 0
time | bench rps min avg rms max vol #N | bench rps min avg rms max vol #N
1.001 | set: 126.223K 5.027us 7.779us 8.250us 157.693us 6.059Mbps 126.327K | get - - - - - - -
2.001 | set: 130.709K 6.296us 7.523us 7.693us 39.340us 6.274Mbps 257.089K | get - - - - - - -
3.002 | set: 122.507K 6.370us 8.021us 8.467us 607.975us 5.880Mbps 379.647K | get - - - - - - -
4.002 | set: 123.721K 6.498us 7.948us 8.166us 140.770us 5.939Mbps 503.420K | get - - - - - - -
5.003 | set: 124.238K 6.475us 7.922us 8.123us 104.968us 5.963Mbps 627.714K | get - - - - - - -
6.003 | set: 108.162K 6.604us 9.082us 9.517us 411.214us 5.192Mbps 735.927K | get - - - - - - -
7.394 | set: 14.143K 6.634us 70.541us 8.493ms 1.191s 678.884Kbps 755.603K | get - - - - - - -
8.397 | set: 109.924K 6.698us 8.953us 14.354us 2.771ms 5.276Mbps 865.879K | get - - - - - - -
10.577 | set: 36.224K 6.652us 27.466us 5.277ms 1.483s 1.739Mbps 944.842K | get - - - - - - -
11.579 | set: 55.083K 7.879us 12.203us 370.741us 86.997ms 2.644Mbps 1.000M | get: 375.055K 347.000ns 768.000ns 874.000ns 31.745us 6.001Mbps 375.566K
12.113 | set - - - - - - - | get: 1.168M 306.000ns 772.000ns 902.000ns 180.391us 18.690Mbps 1.000M
complete.
v0.10.3
is planned for the end of this week.
MDBX_NOSUBDIR
при создании исходной БД.
MDBX_NOSUBDIR
, т.е. создавать новые БД без дополнительной директории. В свою очередь при открытии libmdbx автоматически обрабатывает оба варианта.MDBX_NOSUBDIR
в исходной БД и интерпретировала аргумент именно как имя целевого файла, а не имя директории.MDBX_NOSUBDIR
.mdbx_env_open()
, т.е. до вызова mdbx_dbi_open()
. Чтобы открывать существующую БД без создания новой, следует передавать аргумент mode = 0
.MDBX_CREATE
предназначена для использования с mdbx_dbi_open()
, но не с mdbx_env_open()
.enum MDBX_db_flags_t
задают тип ключей и map/multimap для самого создаваемого набора пар key-value.MDBX_INCOMPATIBLE
вы получаете когда пытаетесь открыть (получить dbi-хендл) для работы с существующим набором key-value передавая в mdbx_dbi_open()
другой/несовместимых набор опций/флагов (на всякий см MDBX_DB_ACCEDE
).mdbx_dbi_open()
с name = NULL
).MDBX_INCOMPATIBLE
;MDBX_CREATE
и целевой набор отсутствует, либо пуст, но допускается смена опций.@MAIN
есть всегда, причем после создания БД она с опциями по-умолчанию (нулевыми).mdbx_dbi_open(NULL, MDBX_CREATE | XXX)
./dev/shm
on an old laptop with an Intel i7-4600U @ fixed 2GHz.$ make bench-mdbx_25000000.txtSo, by this benchmark:
// TIP: Use `make V=1` for verbose.
RUNNING ioarena for mdbx/25000000...
throughput: 124.021Kops/s
throughput: 13.570Mops/s
throughput: 1.138Mops/s
$ make bench-lmdb_25000000.txt
// TIP: Use `make V=1` for verbose.
RUNNING ioarena for lmdb/25000000...
throughput: 108.858Kops/s
throughput: 14.758Mops/s
throughput: 1.211Mops/s
MDBX_NOTLS
| MDBX_RDONLY
. bind_rslot
is expensive on high-concurrency? /proc/self/io
: syscw
=195/sec syscr
=120/sec/proc/self/stat
: Minflt
=2K/sec Majflt=0/sec
MDBX_NOTLS | MDBX_RDONLY
requires to lock/unlock the "Readers Table" for each ones creation and finalization.mdb_txt_reset()
, which will allow it to be reused, otherwise destroy the transaction as usual by mdbx_txn_abort()
.mdbx_txn_renew()
when retrieving a transaction from the pool.pragma pack
for modern Apple's LLVM;make cross-qemu
is still ok.pragma pack
fix.
pragma pack
fix.MDBX_PAGE_NOTFOUND
or MDBX_CORRUPTED
, you will get the 1
as error code (the EPERM
in Linux, INVALID_FUNCTION
in Windows, etc).mdbx_chk
will show its corruption.
MDBX_val key, value
), закончил R/O транзацию, и потом только начал вычитывать (десериализовать) полученные значения. Останутся ли они корректными, если не было новых R/W транзаций?
std::string
не гарантирует выравнивание. Точнее говоря, реализация std::string
в С++ библиотеке от clang гарантирует отсутствие выравнивания.mdbx::buffer
из C++ API.
mdbx::buffer
и вызвать mdbx::buffer::make_freestanding()
.MDBX_EXCLUSIVE
).
mdbx_txn_reset()
+ mdbx_txn_renew()
), то оверхед получится примерно нулевым.mdbx_txn_reset()
+ mdbx_txn_renew()
.
mdbx_dbi_sequence
вызов где не + а -
increment
с u64 на i64
C#
ничего не известно.C++
API.
MDBX_NOTLS
мне помог.
vector<std::string_view>
(aka pointers), send them to different threads, and the last reader closes R/O transaction. ` MDBX_NOTLS
` helped me, I just want to be sure, that everything is OK.
MDBX_SYNC_DURABLE
mode, the write order guarantees the consistency of DB.MDBX_UTTERLY_NOSYNC
mode, then some data (a pages) just has not written and thus couldn't be recovered.mdbx_chk
tool, especially with -0
, -1
,-2
options, for checking all snapshots which pointed by each of three meta-pages; and by -t
option switch to valid one which the maximal transaction id.
mdbx_chk -vvv
(from current master branch) for such DB.
MDBX_SYNC_DURABLE
. strace
or mdbx_chk -vvv
to clarify the causes of problems.
mdbx_chk -vvv
for this DB running on your host system.
mdbx_chk -vvv
for this DB contains:dynamic datafile: 12288 (12.00 Kb) .. 1099511627776 (1.00 Tb)
- current datafile: 2684313600 (2.50 Gb), 655350 pages
Thus this DB is just too large for Raspberry Pi 4, but actually a problems began when the database size reached ≈655350 pages.
strace
firstly rather than gdb
.
MDBX_NOTLS
option.MDBX_DUPSORT
feature which is extremely useful for inverted lists and secondary indices.MDBX_commit_latency
.write
measure? (it measure speed of mdbx_txn_write
- but what it does? ) And what means if this parameter takes > 10 seconds during commit? (MDBX_commit_latency
.sync = 1 sec, MDBX_commit_latency
.gc = 1 sec)
mdbx_cursor_get
. In a few of the mdbx-rs tests we look up a key in an empty database, which results in ERROR_HANDLE_EOF
(38) on Windows but MDBX_NOTFOUND
on Unix. We could work around this in the Rust bindings, but it seems like it should be fixed on the MDBX side?mdbx_cursor_get()
' issue yet.MDBX_NOTFOUND
and MDBX_ENODATA
are:MDBX_NOTFOUND
is returned for an unsuccessful but valid search operation, or similarly for a cursor move operation from valid state.MDBX_ENODATA
is returned for a get- or a move operation which is not valid for current cursor state.MDBX_ENODATA
will be returned for MDBX_GET_CURRENT
operation for empty DB or for MDBX_NEXT
when a cursor is in the eof-of-file state.MDBX_ENODATA
depends on the system:MDBX_ENODATA
== ENODATA
on systems that defined it nativelly (Linux, but not *BSD);MDBX_ENODATA
== ERROR_HANDLE_EOF
on Windows;MDBX_ENODATA
== -1
on *nix without ENODATA
in the errno.h
;MDBX_ENODATA
== 9919
from CLANG C++ headers on *nix without ENODATA
in the errno.h
;MDBX_ENODATA
. I've updated the Rust bindings to handle that error and the tests are passing. Thanks!
devel
branch (https://github.com/erthink/libmdbx/tree/devel).v0.11.2
планируется до начала зимы.
In general, the bad ideas for performance:
- using a large number (100 and more) of subDB.
- using key-prefix instead of subDB for large number (10^7 and more) of items.
__hot
and likely
/unlikely
macros, etc) which are allows compiler more aggressively optimization that in many cases lead to increase code volume (i.e. inlining, etc).
-Os
, static library, LTO (link-time optimization) as for _libmdbx_ and your APP or bindings.
MDBX_opt_rp_augment_limit
affect only fetching records from GC and to increasing the reclaimed_pglist
of the current write-transaction in RAM inside mdbx_page_alloc()
.reclaimed_pglist
as a large retired_pages
both, will be chunked by me_maxgc_ov1page
inside mdbx_update_gc()
if a free GC-ids are available to push such records into GC.ms_overflow_pages
in the header
git grep overflow
?
/* LY: add configurable threshold to keep reserve space */
valsize_max
does some calculations based on max num of normal pages...mdbx_cursor_put
there's me_leaf_nodemax
, but what is its value?
mdbx_pnl_check
. Do u know why it might happen or what can I do with it?Assertion failed: ((pl)[1]) < limit (mdbx: mdbx_pnl_check: 6368)It happens after very long opened and heavy cursor. Database size is 4tb+.
SIGABRT: abort
PC=0x7f3cf16ad3f2 m=37 sigcode=18446744073709551610
signal arrived during cgo execution
failed MdbxKV cursor.Next(): mdbx_cursor_get: MDBX_PAGE_NOTFOUND: Requested page not found
MDBX_MAP_FULL: Environment mapsize limit reached
. Подскажите, что с этим делать?
Status of Main DB
Pagesize: 4096
Tree depth: 3
Branch pages: 3
Leaf pages: 95
Overflow pages: 43
Entries: 4914
mdbx_env_create(&env);
auto flags = MDBX_WRITEMAP | MDBX_COALESCE | MDBX_LIFORECLAIM | MDBX_EXCLUSIVE | MDBX_NOTLS;
auto r = mdbx_env_open(env, db_dir.c_str(), flags, 0664);
std::
and other DB with properly cursors:mdbx_env_set_geometry()
, меня всё устраивает по-дефолту, и, как я понял, по-дефолту она же должна расти, если вдруг не хватает место. Во всяком случае я так понял "automatic size management" . Что мне нужно сделать, чтобы не получать MDBX_MAP_FULL
в процессе работы (вставок в БД)?
mdbx_env_set_geometry()
) поведение libmdbx соответствует LMDB по-умолчанию (и предельный размер там меньше).mdbx_env_set_geometry()
.
MDBX_NOTXN
the txn object is binded to a slot of environment' reader table.
malloc()
/free()
overhead.v0.11.3
.
v0.11.3
on New Year's Eve.mdbx_env_create(...);More details:
mdbx_env_set_mapsize(...);
mdbx_env_set_maxdbs(..., 8);
mdbx_env_open(...);
mdbx_txn_begin(...); // with flags=0
mdbx_dbi_open(...); // with name & with MDB_CREATE
mdbx_txn_commit(...); // segfaults here!
* frame #0: 0x0000000001e3dc87 mdbx_cursors_eot(txn=0x0000621000003d00, merge=1) at mdbx.c:8575:28Here, there 3 cursor entries (I geuss that is for 2 core dbs and 1 for newly added one).
frame #1: 0x0000000001e3c8d2 mdbx_txn_commit(txn=0x0000621000003d00) at mdbx.c:10606:5
frame #0: 0x0000000002d029f6 mdbx_cursors_eot(txn=0x0000621000003d00, merge=1) at mdbx.c:8575:28
8572
8573 for (i = txn->mt_numdbs; --i >= 0;) {
8574 for (mc = cursors[i]; mc; mc = next) {
-> 8575 unsigned stage = mc->mc_signature;
8576 mdbx_ensure(txn->mt_env,
8577 stage == MDBX_MC_SIGNATURE || stage == MDBX_MC_WAIT4EOT);
8578 next = mc->mc_next;
./mdbx_chk -V
/* MDBX version 0.7.0, released 2020-03-18 */
mdbx_dbi_open
really lightweight? can it be used for any new transaction?
mdbx_dbi_open()
for every transaction.MDBX_RESERVE
put's option or by last get-operation from the DB opened with MDBX_WRITEMAP
option;MDBX_node
structures even-byte aligned there are at the end of (non-MDBX_DUPSORT_FIXED) pages be inside a DB.MDBX_opt_rp_augment_limit = MDBX_PGL_LIMIT
(0x7FFFffff для 64-битных сборок).
futex_wait()
is now available since 5.16! mdbx_env_open()
и mdbx_env_close()
?
mdbx_env_close()
при проблемном сценарии.
strace
на Linux.mdbx_chk
tools from current release and some old version(s).
mdbx_cursor_txn()
or submit a PR with the addition of the appropriate method.
MDBX_MAP_FULL: Environment mapsize limit reached
. На этот раз точно вызывается mdbx_env_set_geometry(env, 0, -1, 0, -1, -1, 0)
, после которого я рассчитывал на "automatic size management". ЧЯДНТ?
mdbx_env_set_geometry(env, 0, -1, 0, -1, -1, 0)
означает:mdbx_env_set_geometry(env, -1, -1, upper_limit_of_db_size, -1, -1, -1)
MDBX_SAFE_NOSYNC
... a system crash can't corrupt the database, but you will lose the last transactions; auto flags = MDBX_WRITEMAP | MDBX_COALESCE | MDBX_LIFORECLAIM | MDBX_EXCLUSIVE | MDBX_NOTLS | MDBX_SAFE_NOSYNC;
MDBX_CORRUPTED: Database is corrupted
. WTF?
mdbx_env_sync_poll()
и достижении порогов заданных mdbx_env_set_syncbytes()
или mdbx_env_set_syncperiod()
;mdbx_env_sync()
;mdbx_chk -vvv
для поврежденной БД и покажите вывод утилиты.
q
(принудительный выход). Вроде так.
MDBX_UTTERLY_NOSYNC
при повторном открытии будет совпадать bootid, поэтому weak-точки фиксации не будут отбраковываться.
NDEBUG
) это не влияет на производительность, но вы увидите явные причины MDBX_CORRUPTED
.
MDBX_WRITEMAP
рекомендуется использовать только после достижения полной уверенности в корректности кода приложения.mdbx_setup_debug()
.mdbx.h
.
Thread 2 "ss/net" received signal SIGBUS, Bus error.
[Switching to Thread 0x7ffff6bee640 (LWP 20006)]
0x0000555555a16b18 in mdbx_page_alloc (mc=0x7ffff6becff0, num=1, flags=67108871) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:6752
6752 ret.page->mp_pgno = pgno;
(gdb) bt
#0 0x0000555555a16b18 in mdbx_page_alloc (mc=0x7ffff6becff0, num=1, flags=67108871) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:6752
#1 0x0000555555a1785e in mdbx_page_touch (mc=0x7ffff6becff0) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:6881
#2 0x0000555555a50170 in mdbx_cursor_touch (mc=0x7ffff6becff0) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:14760
#3 0x0000555555a51a9b in mdbx_cursor_put (mc=0x7ffff6becff0, key=0x7ffff6bed3e0, data=0x7ffff6bed3f0, flags=0) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:15078
#4 0x0000555555a7255e in mdbx_put (txn=0x7ffff0005340, dbi=1, key=0x7ffff6bed3e0, data=0x7ffff6bed3f0, flags=0) at /home/b/development/tmp/syncspirit/lib/mbdx/src/core.c:18619
#5 0x000055555588308d in syncspirit::db::save (container=..., txn=...) at /home/b/development/tmp/syncspirit/src/db/utils.cpp:135
-DMDBX_FORCE_ASSERTIONS=1
и попробовать воспроизвести проблему.
NMB1XXD128GPSU
.python-bindings
.maxdbs
large enough.maxdbs
and/or to the number of currently used/opened handles.
C API
error codes:MDBX_RESULT_FALSE
, and the false
because zero is here.MDBX_RESULT_TRUE
(successful result with special meaning or a flag) == -1, and the true
because non-zero.make dist
or point git submoduke to the any commit.
mdbx_chk -vvv
, mdbx_chk -vvvv
, mdbx_chk -vvvvv
to to get information about the number of pages and their fullness.mdbx_chk -vvv
is small enough to be shown/post here and get some answers. And then, I think, you can figure it out for yourself.
584/4 - 3 = 143
pages);mdbx_is_readahead_reasonable()
' result for the actual DB size.
ChangeLog.md
) as soon as there is free time.
mdbx_txn_begin()
передан какой-то левый указатель.mdbx_is_dirty()
.LIBMDBX_API int mdbx_cursor_get ( MDBX_cursor * cursor,
MDBX_val * key,
MDBX_val * data,
MDBX_cursor_op op
)
[in,out] data The data of a retrieved item.
data
как входного параметра? А то он у меня на стеке лежит, и всякий мусор содержит?
strace
чтобы понять какой системный вызов возвращает EINVAL
, либо проблема где-то в другом месте.__ANDROID_API__
при сборке соответствовало платформе (ядру и bionic).
.git
mmap()
есть масса ограничений).fcntl64(F_OFD_SETLK)
.
fcntl64(59, F_OFD_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=4294967296, l_len=4113621231163408384})
=> EINVALF_OFD_SETLK
и EINVAL тут вполне может быть.l_start=4294967296
и` l_len=4113621231163408384`не верные, таковых в исходном коде нет.fcntl64(fd, F_OFD_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=1})
.F_OFD_SETLK
происходит fallback на F_SETLK
:fcntl64(59, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=1})
=> OKfcntl64(49, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=-65536})
=> EINVALFFFF0000
превратился в -65536
.
devel
но без последних коммитов) и собрать с включенными ассертами (-DCMAKE_BUILD_TYPE=Debug
или -DMDBX_FORCE_ASSERTION=ON
).
fcntl64()
, который есть только на 32-битных платформах и обязан принимать 64-битные смещения.lighthouse: mdbx:18954: mdbx_cursor_put: Assertion `(char )olddata.iov_base + olddata.iov_len <= (char)(mc->mc_pg[mc->mc_top]) + env->me_psize' failed.
mdbx_chk
for now).#ifndef _FILE_OFFSET_BITS`добавил явно `#define _FILE_OFFSET_BITS 64
, так давно что забыл об этом.off64_t
это определение должно быть проигнорировано, либо в худшем случае привести к ошибке/предупреждению, которое лечится определением _FILE_OFFSET_BITS в параметрах сборки.fcntl64()
._FILE_OFFSET_BITS=64
всё собирается (без предупреждений!) и даже используется 64-битный системный вызов, но ему передается указатель на 32-битную версию структуры (т.е. на левые параметры).
MDBX_node
instances. Therefore, in order to get the right alignment, it is necessary and sufficient that: (size of(MDBX_node) + node_key.length + node_data.length) % alignment == 0
for each item.std::assume_aligned<>
, etc.mdbx::put
-operations, since each of ones can move a specific element (i.e. change the actual RAM address of it).git revert befb8dd2033a0aa4ecc300935802d7de134038fa
git revert befb8dd2033a0aa4ecc300935802d7de134038fa
if you're in a hurry.
v0.11.7
release was republished today to made archives be downloadable without authorization at GitFlic, but (therefore) the release ID/URL has also changed;mdbx::env_managed
.
git checkout master && git reset --hard origin/master
.
v0.11.7
release (https://gitflic.ru/project/erthink/libmdbx/release/90ec9985-cd60-4d9a-8c98-8417506fd26d )v0.11.6-6-g18789654
from 2022-03-27, i.e. this version is enough for stable operation.v0.11.6
without the last fix d5220690
and should be updated.MDBX_LOCKING
-DNDEBUG
), aka debug build.GNUmakefile
and CMakeLists.txt
are provided for GNU Make and CMake correspondently.strip
utility to remove debug information.
./mdbx_chk -V
output.
mdbx_ensure()
checks (git grep mdbx_ensure |wc
=> 117 564 7830
), which I prefer to leave even in release builds.mdbx.h
и/или на libmdbx.dqdkfa.ru (содержимое генерируется doxygen + make).mdbx_txn_commit: (-30792) MDBX_MAP_FULL: Environment mapsize limit reached
что мне делать с этим ?
for ( int i = 1350; i; i--)
{
key.iov_len = snprintf(l_key, l_key - 1, "key - %d", i);
data.iov_len = snprintf(l_val, l_val - 1, "key - %d", i);
if ( MDBX_SUCCESS != (rc = mdbx_txn_begin(env, NULL, 0, &txn)) )
{
$LOG(STS$K_ERROR, "mdbx_txn_begin: (%d) %s", rc, mdbx_strerror(rc));
goto bailout;
}
if ( MDBX_SUCCESS != (rc = mdbx_put(txn, dbi, &key, &data, 0)) )
{
$LOG(STS$K_ERROR, "mdbx_put: (%d) %s", rc, mdbx_strerror(rc));
goto bailout;
}
if ( MDBX_SUCCESS != (rc = mdbx_txn_commit(txn)) )
{
$LOG(STS$K_ERROR, "mdbx_txn_commit: (%d) %s", rc, mdbx_strerror(rc));
goto bailout;
}
}
unix
in os
unix
in os
unix
in os
unix
module is a hard dep