Leo Yuriev
7bf9d381ee
mdbx: minor simplify mdb_del0().
2017-01-31 19:16:16 +03:00
Leo Yuriev
61e1efeb85
mdbx: add mdbx_dbi_open_ex() for libfpta.
2017-01-31 02:52:59 +03:00
Leo Yuriev
55c43291c6
mdbx: undef NDEBUG when MDB_DEBUG != 0.
2017-01-30 20:17:33 +03:00
Leo Yuriev
cc6e1c5119
mdbx: fix MDB_CURRENT for mdb_cursor_put() with MDB_DUPSORT.
2017-01-24 20:51:23 +03:00
Leo Yuriev
6aa60c61c5
mdbx: allows cursors to be free/reuse explicitly, regardless of transaction wr/ro type.
2017-01-24 20:21:51 +03:00
Leo Yuriev
8b045ab626
mdbx: MDBX_EMULTIVAL errcode for libfpta.
2017-01-24 19:10:35 +03:00
Leo Yuriev
5bb931f7c4
mdbx: fix xflags inside mdb_cursor_put().
...
Fix xflags preparation bug from 2956095c6d
2017-01-18 19:05:48 +03:00
Leo Yuriev
14b466bd2d
mdbx: fix cursor EOF tricks.
...
LY: Don't touch cursor's C_EOF flag in functions
that don't moves the cursor.
HYC: Further fix f8ce8a82717ddefdc912fa47c07f1bdee2a3336b
Fully revert the change to GET_MULTIPLE
Change-Id: Ia8e6dc0af04e5c7b2fd1a2fc9632ccfecc01819a
2017-01-18 17:48:32 +03:00
Howard Chu
460eb64a6f
mdbx: backport - Tweak cursor_next C_EOF check.
...
Squash of relevant commits.
HYC: Allow C_EOF flag to be stale.
LY: Fixed parenthesis arrors.
Change-Id: I5a26498763358a08f98481cacf582c881d59393d
2017-01-13 00:50:15 +03:00
Leo Yuriev
97e1d9b685
mdbx: fix mdb_cursor_last (ITS#8557).
...
This is a port of http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commit;h=d84dee516fa4cca41b5234e95c2105eb4737dfb3
HYC: Optimize mdb_page_search_root(PS_LAST) when cursor is already
near last position, ignoring C_EOF flag for now.
LY: Fixed C_EOF check. Don't ignore it, otherwise in some cases
we got a "MDB_PAGE_NOTFOUND", instead of just "MDB_NOTFOUND".
Change-Id: I2edbf6b64403abfa830a2fcb84162125634a85d0
2017-01-13 00:50:07 +03:00
Leo Yuriev
f8a14d7d54
mdbx: Merge branch 'positive' into 'devel' branch.
2017-01-08 14:27:31 +03:00
Leo Yuriev
9c02fad4cd
mdbx: support glibc < 2.18 for TLS cleanup on thread termination.
...
One more for https://github.com/ReOpen/ReOpenLDAP/issues/48
against https://sourceware.org/bugzilla/show_bug.cgi?id=21031
and https://sourceware.org/bugzilla/show_bug.cgi?id=21032
It is impossible to completely fix this issue for glibc prior to 2.18,
in such case this fix just minimizes the probability of a crash.
Change-Id: If2317275928e8f6d96c2682df99989da03aedaaa
2017-01-07 21:14:47 +03:00
Leo Yuriev
02de457f3c
mdbx: more rework TLS cleanup on thread termination.
...
One more re-fix https://github.com/ReOpen/ReOpenLDAP/issues/48
Here is only part of the work for glibc >= 2.18
--
Unfortunately, the two bugs related to pthread_key_delete()
are present in all glibc versions:
1) The race condition between pthread_key_delete() and thread's
finalization path, from where a TSD-destructors are called.
Therefore some TSD-destructor(s) could be executed after that
the pthread_key_delete() was competed.
2) ld.so infrastructure does not tracks a TDS-destructors.
Therefore a lib.so could be unloaded while corresponding a
TSD-destructor(s) were even not completed or still were not called.
Change-Id: I47eba97df57fd4c7a5bf3a8f9f12d72ba898cae5
2017-01-06 18:39:03 +03:00
Leo Yuriev
ee4d5bb5d2
mdbx: rework TLS cleanup on thread termination.
...
Re-fix https://github.com/ReOpen/ReOpenLDAP/issues/48
Change-Id: Ie47d2ede0f47b382a30ab6a27546f249f56cf4f6
2017-01-04 00:09:50 +03:00
Leo Yuriev
855c60a554
mdbx: remote extra LNs (cosmetics).
...
Change-Id: I3ea352c9d088367756543f8313d6598de3b80bf0
2017-01-03 16:45:23 +03:00
Leo Yuriev
5b160be128
mdbx: assert_fail() when INDXSIZE(key) > nodemax
.
...
Change-Id: I2fadc68a3e682dd3d8b3b8b5f48ed096e9a92288
2017-01-03 16:11:19 +03:00
Leo Yuriev
ddb3c32258
mdbx: HNY 2017!
...
Change-Id: Ie80fc1dc407ec45c828aa3b1bdc42933741a863a
2017-01-01 14:56:00 +03:00
Leo Yuriev
dbc57d3eaf
mdbx: fix cursor_count() for libfpta.
2016-12-23 15:35:42 +03:00
Leo Yuriev
68cac36832
mdbx: Merge branch 'devel' into 'pt' branch.
2016-12-23 05:03:27 +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
Leo Yuriev
a866d8b6c2
mdbx: Merge branch 'devel' into 'pt' branch.
2016-12-20 08:51:07 +03:00
Leo Yuriev
efcf60dfaa
mdbx: fix MDB_GET_CURRENT for dupsort's subcursor.
2016-12-18 20:16:55 +03:00
Leo Yuriev
578fe9e258
mdbx: allows zero-length keys for libfpta.
2016-12-18 00:58:26 +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
2956095c6d
mdbx: rework MDB_CURRENT handling for libfpta.
2016-12-15 22:06:06 +03:00
Leo Yuriev
b4dc91d276
mdbx: Merge branch 'devel' into 'pt' branch.
2016-12-15 22:05:45 +03:00
Leo Yuriev
5865c74876
mdbx: rework overwrite support for mdbx_put().
2016-12-15 22:03:33 +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
9775b409bc
mdbx: Merge branch 'devel' into 'pt' branch.
2016-12-06 21:20:23 +03:00
Leo Yuriev
f9f132671c
mdbx: explicit overwrite support for mdbx_put().
2016-12-06 20:08:08 +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
787aeea162
mdbx: Merge branch 'devel' into 'pt' branch.
...
Change-Id: Ieac23894deaffdc5e5e5110471f0491e0605c7d8
2016-11-27 11:11:34 +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
17c6555a7f
mdbx: add 'canary' support for libfpta.
...
Change-Id: I62c68f149adf38d65aa9371a1fb3adac405d23ed
2016-11-27 03:46:22 +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