Commit Graph

240 Commits

Author SHA1 Message Date
Leo Yuriev
ddb3c32258 mdbx: HNY 2017!
Change-Id: Ie80fc1dc407ec45c828aa3b1bdc42933741a863a
2017-01-01 14:56:00 +03:00
Hallvard Furuseth
5bed0413f3 mdbx: backport - More MDB_node doc.
Change-Id: I2a4d2596af8d2c551d891b567e4d3366b2d6ad8c
2016-12-23 04:47:38 +03:00
Hallvard Furuseth
ef00ee6095 mdbx: backport - Doxygen fixes. Use DISTRIBUTE_GROUP_DOC.
- DISTRIBUTE_GROUP_DOC makes doxygen give several fields the
  same doc: mn_hi + mn_lo in MDB_node.
- Don't hide a doxygen #name inside double quotes.

Change-Id: I173ff54a78349344d38e175cf9de741efab29e82
2016-12-23 04:45:52 +03:00
Lorenz Bauer
b950e39c10 mdbx: backport - mdb_env_copyfd2(): Don't abort on SIGPIPE (ITS#8504).
Return EPIPE instead.
Never clear mc_error, we could lose a failure in the other thread.

Change-Id: Ief08803ed56293309f07be116e69123c10907e77
2016-12-16 08:27:52 +03:00
Leo Yuriev
cbff647579 mdbx: fix ov-pages copying in cursor_put().
I think I just lost one line of code.
This bug was added by 09d7904317
2016-12-15 20:09:28 +03:00
Hallvard Furuseth
3627145129 mdbx: backport - catch mdb_cursor_sibling() error (ITS#7377).
Change-Id: I440ff1f9f92156e19935195d656f4d77b088f605
2016-12-11 08:43:13 +03:00
Hallvard Furuseth
fca2f4d929 mdbx: backport - clean up and comment C_UNTRACK.
Don't use it as a "cursor is tracked" hint in mdb_pages_xkeep().
It's been harmless so far, but would break after mdb_cursor_copy().
Checking m0 directly short-circuits better anyway.

Change-Id: Ibf180214db603e08ed11e298cff85866eb79f4bb
2016-12-11 08:31:50 +03:00
Hallvard Furuseth
fe4e9993d6 mdbx: backport - Pass cursor to mdb_page_get(), mdb_node_read().
No change in behavior.

Change-Id: I19054cfd96fa883970a0dc66a0088596a142ea07
2016-12-10 20:41:48 +03:00
Hallvard Furuseth
ca97abb7f3 mdbx: backport - mdb_dbi_open(): Protect mainDB cursors (ITS#8542).
Change-Id: I5bdd3727eddc16a518c4b88534a3e7253e9789fd
2016-12-10 16:21:22 +03:00
Hallvard Furuseth
7b773e6f2d mdbx: backport - Cleanup: Add flag DB_DUPDATA, drop DB_DIRTY hack.
Change-Id: I5d30367104d025c1d2f8c39d29455faca59d7f19
2016-12-10 16:18:26 +03:00
Hallvard Furuseth
207f43003c mdbx: backport (comments) - MDB_CP_COMPACT comments.
Change-Id: I4965d5e511395fceafcd922f513dcf0d5050c9b8
2016-12-08 00:55:28 +03:00
Hallvard Furuseth
baf61da42b mdbx: backport (minor) - doxygen cleanup.
Change-Id: Ide60614f4fc631aa2bfba3609115f39ec294b3de
2016-12-08 00:55:11 +03:00
Hallvard Furuseth
ba688e63dc mdbx: backport (comments) - Note functions which must set MDB_TXN_ERROR on failure.
Other functions depend on them to do so.
For mdb_node_read(), instead remove such a dependence.

Change-Id: I49c1c8bbb1c20527cbf76ef004cb7a1300ef465c
2016-12-08 00:54:30 +03:00
Leo Yuriev
2fb5a54264 mdbx: minor simplify mc_signature.
Change-Id: Ib3952853350d220dd62910bcd55ac74cf5f47886
2016-12-03 17:39:26 +03:00
Hallvard Furuseth
2196a9b72c mdbx: backport - factor out refreshing sub-page pointers.
Change-Id: If2d3efde19ff751da208959f6f2834ece1f64e56
2016-12-03 13:50:09 +03:00
Howard Chu
533ad276bb mdbx: backport - more for cursor tracking after deletion (ITS#8406).
xcursor fixup depends on init state

Change-Id: I13139c401e2ae6bbe3d7e6b9fda3739f9ec789cf
2016-11-30 00:14:32 +03:00
Leo Yuriev
ae61e9ebdf mdbx: distinct signature of internal objects for LMDB/MDBX modes. 2016-11-27 11:08:53 +03:00
Leo Yuriev
aa4fd0ec76 mdbx: more isolation MDBX/LMDB API. 2016-11-22 13:08:59 +03:00
Howard Chu
b7502306c1 mdbx: backport - More for ITS#8406.
Revert excess cursor fixup

Change-Id: Ic1863feda49e793dd8890a77bd9bf223d1320826
2016-11-13 13:04:57 +03:00
Leo Yuriev
38d57e66c6 mdbx: use O_CLOEXEC/FD_CLOEXEC for me_fd,env_copy as well (ITS#8505).
Change-Id: I1db158f1371e557a78fc11fc0ca9e371d1590067
2016-10-25 09:12:11 +03:00
Hallvard Furuseth
9a8270f427 mdbx: backport - ITS#7682 F_NOCACHE: Allow error, skip any O_DIRECT.
We can run without F_NOCACHE if it fails. And we do not know
what combining it with O_DIRECT means, if a system has both.

Change-Id: Iec12b7097f4ed9f3ea5beae4a2deb874e4118131
2016-10-25 08:27:46 +03:00
Hallvard Furuseth
f3b99004d1 mdbx: backport - Silence warning for initializer "mdb_copy my = {0}".
1st struct member was not a scalar.

Change-Id: If52afc241f30b6af77a608a41178cbe929ceb288
LY: Already fixed in libmdbx, but to be closer to LMDB.
2016-10-25 08:19:21 +03:00
Leo Yuriev
43d87b4d97 mdbx: move to the OpenLDAP Public License.
Finally for https://github.com/ReOpen/libmdbx/issues/3
2016-09-27 13:44:23 +03:00
Howard Chu
c25b01b5b6 mdbx: backport - reset cursor EOF flag in cursor_set (ITS#8489).
It usually gets done anyway, but one of the fastpath shortcuts
bypassed this step.

Change-Id: I89d3c797ce969524e383b093dcf592579a514de1
2016-09-06 08:19:09 +03:00
Leo Yuriev
796c4f5bc2 mdbx: fix usage of __attribute__((format(gnu_printf, ...)) for clang.
Change-Id: Iaf3890a9c915f63896822f430b219bc107037540
2016-08-25 21:10:52 +03:00
Hallvard Furuseth
b99cb20483 mdbx: minor fix mdb_page_list() message.
Change-Id: I25697a7123aef182762a91536e54ca118d6a0958
2016-08-25 17:34:07 +03:00
Leo Yuriev
5239bce5e5 mdbx: adds minor assert.
More for ae92d0d671.

Change-Id: I32f8f54ec5888fe794b83d42ed7f5ae0138070d4
2016-08-24 11:52:36 +03:00
Leo Yuriev
ae92d0d671 mdbx: fixes issues detected by PVS-Studio.
See http://www.viva64.com/en/b/0422/

This is Partial for https://github.com/ReOpen/ReOpenLDAP/issues/107

Change-Id: Ic47d3cb1ff88ca0807bdd692a1e01487c70b264c
2016-08-22 14:39:45 +03:00
Leo Yuriev
bc7b9984d3 mdbx: fix copyright timestamps.
1 of 2 for https://github.com/ReOpen/libmdbx/issues/3

Change-Id: I7a0b820e092e7b0064ae22341bebcd015e37b7c7
2016-08-22 13:46:40 +03:00
Leo Yuriev
a306a1eac4 mdbx: fix assertions when debug enabled for various open/sync modes.
No bug is here, but had a wrong condition for assertion-check.

Change-Id: I6db76932e235f8212543fdd160a15cc9299d79e8
2016-08-18 17:09:09 +03:00
Leo Yuriev
7cfcc9ff7a mdbx: check assertions depending on NDEBUG.
Change-Id: I0c8ce98242e7451dd82f8abfbac70b2f4dcfa7a0
2016-08-18 17:09:09 +03:00
Hallvard Furuseth
ac09708bfe mdbx-doc: comment MDB_page, rename mp_ksize.
Change-Id: Ia9d28a76fe0b51ccfc40ba97b913f064b81bc00e
2016-08-04 10:44:39 +03:00
Hallvard Furuseth
85612d9722 mdbx-doc: VALID_FLAGS, mm_last_pg, mt_loose_count.
Change-Id: I6c615244d8b137ac4ed67fb7be70e8ccd4e7cac4
2016-08-04 10:44:33 +03:00
Hallvard Furuseth
f627930bdc mdbx: backport - Refactor mdb_page_get().
Change-Id: I6a44000d954025f87637c8b60da85b210b4df65e
2016-07-26 17:13:06 +03:00
Leo Yuriev
a3a98a7a2e mdbx: fix 'mdb_copy' init warning.
Change-Id: Ifc3d0b565a0dd6d6da40e7fe2be2c9ff0f5458fb
2016-07-20 12:51:52 +03:00
Hallvard Furuseth
dd98ab22da mdbx: backport - Add error MDB_PROBLEM, replace some MDB_CORRUPTED.
When problem is most likely in txn, not on disk.

Change-Id: Ie01d9eb32e8f250f6dd98f3fe84c38ed15593a2e
2016-07-18 18:34:59 +03:00
Hallvard Furuseth
3befcdab01 mdbx: backport - ITS#8209 fix MDB_CP_COMPACT.
Handle errors.  Fix cond_wait condition so mc_new
is the sole control var.  Drop specious cond_waits.
Do not look at 'mo' while copythr writes it.

Preserve DB flags (use metapage#1) when main DB is empty.
Fail if metapage root != actual root in output file.

Some _aligned_malloc() doc seems to think arg NULL = user error.
Don't know if posix_memalign() pointer is defined after failure.

Change-Id: Idfdc118b4848bb96bace0f29db9dcdd710b7a1f4
2016-07-18 18:34:07 +03:00
Leo Yuriev
6d99bb59a8 mdbx: use __GNUC_PREREQ and __GNUC_PREREQ.
Change-Id: Ib1927f6ab2e3397fb2a0e83a73c5c0252bc8a593
2016-06-09 15:23:47 +03:00
Leo Yuriev
9c5d029417 mdbx: clarify copyright and license.
Change-Id: Ib1b9516ce09497559937f749d520719046c5b7e6
2016-06-09 13:21:20 +03:00
Leo Yuriev
0e90ea1d8d mdbx: separate MDBX's features.
Change-Id: I1964ee5d8b8e5fca170b8e955bfc1a6efe25f6c5
2016-06-09 08:54:46 +03:00
Hallvard Furuseth
f5c61018ba mdbx: backport - mdb_env_setup_locks() Plug mutexattr leak on error.
Change-Id: Iac82f957e4961ec964d9d0a75ef0b24a9f68929c
2016-06-09 04:18:55 +03:00
Howard Chu
2806453b54 mdbx: backport - ITS#8339 Solaris 10/11 robust mutex fixes.
Check for PTHREAD_MUTEX_ROBUST_NP definition (this doesn't work
on Linux/glibc because they used an enum). Zero out mutex before
initing.

Change-Id: Ic618a6a72fbd7680dd76d5fd0aef06545dcba994
2016-06-09 03:11:05 +03:00
Leo Yuriev
3deb4577fb mdbx: fix build by clang (missing-field-initializers).
Change-Id: I45b966a6572d0669596106c3c70862dc113fb642
2016-06-06 01:53:00 +03:00
Leo Yuriev
f943bbf91c mdbx: more for ASAN.
Change-Id: I2bd0573cfe4c7822fa8f3cf94db60b684964a40d
2016-05-19 22:05:46 +03:00
Howard Chu
856f30b52c mdbx: backport - ITS#8424 init cursor in mdb_env_cwalk.
Change-Id: I979b6f492c56d1c61ce233727ff058df48f327d1
2016-05-16 17:46:45 +03:00
Leo Yuriev
09d7904317 mdbx: clarify ov-pages copying in cursor_put().
Change-Id: I48ae57579a7d68178ec1857785ffdd6f0c0f7e13
2016-05-10 13:21:38 +03:00
Hallvard Furuseth
1ef0106b51 mdbx: backport - Comment ovpage code in mdb_cursor_put().
Change-Id: I6b3bff87dc49135fdda3e9ce0a505822ab26d3d5
2016-05-10 13:15:05 +03:00
Leo Yuriev
7c3c28239c mdbx: more likely/unlikely for mdb_node_add.
Change-Id: I1f241c6cea55db6fed744ba9f6f5733f6622015f
2016-05-08 02:29:59 +03:00
Leo Yuriev
4d3e349c16 mdbx: don't memcpy when src eq dest.
Workaround for 'destination overlaps source' from Valgrind.

Change-Id: Ib12eacbd224057334311816346ea0ccece2b42cf
2016-05-07 23:44:41 +03:00
Leo Yuriev
8791e3243f mdbx: workaround for pthread_setspecific's memleak.
Change-Id: I8b48548a40bb2fe58db14b8f6944f5a3802ffbb9
2016-05-07 15:21:59 +03:00