4270 Commits

Author SHA1 Message Date
Leo Yuriev
c81942a2a6 mdbx: pull CHANGES from LMDB.
Change-Id: I008d23776ea78352de582f7e93446edbed75d094
2015-12-25 19:49:22 +03:00
Howard Chu
926db32902 mdbx: backport - MDB_RESERVE doc.
Add mdb_put text to mdb_cursor_put description for people who
fail to draw logical conclusions.

Change-Id: I7d17178ad3b0d2ada721f3027af7e70f478c0da1
2015-12-25 19:49:11 +03:00
Howard Chu
ebaf7c8d41 mdbx: backport - Add Getting Started doc.
Change-Id: I41847e550dc8246fca293bef3d103c35d43f3001
2015-12-25 19:49:01 +03:00
Leo Yuriev
3ce58a015f mdbx: Merge branch 'devel'. 2015-12-16 22:00:38 +03:00
Leo Yuriev
c0c3c1b688 mdbx: force gdb-level3 for debuginfo.
Change-Id: Ie11630f4c56482862d765764e5e0c4c9564a476b
2015-12-16 21:35:43 +03:00
Leo Yuriev
7086623d9f mdbx: drops include <ansidecl.h>
Change-Id: Ie7253b2515a6a4cd4a0d976f22d4713f99126ef2
2015-12-16 20:33:56 +03:00
Hallvard Furuseth
b067025e8b mdbx: backport - Catch strdup failure in mdb_dbi_open().
Change-Id: I754e8c966cc093f162cfbb33d3b179585e3ea4a2
2015-12-15 12:45:54 +03:00
Leo Yuriev
c0566f94c4 mdbx: Merge branch 'devel'. 2015-12-13 20:03:42 +03:00
Leo Yuriev
efda814f7e mdbx: minor flags cleanup.
Change-Id: I6ebb0d76963c0bf41051ca97fba4ec6f564519e2
2015-12-13 19:49:53 +03:00
Howard Chu
3df7c4b1e1 mdbx: backport - ITS#8336 fix page_search_root assert on FreeDB.
Let "illegal" branch pages thru on the FreeDB - the condition
is only temporary and will be fixed by the time rebalance finishes.

Change-Id: I5d34fd96096f88638db55166aba7194dcef7e429
2015-12-13 19:49:22 +03:00
Hallvard Furuseth
4fcbaa44f3 mdbx: backport - ITS#8334 Fix MDB_APPENDDUP vs. rewrite(single item).
Change-Id: I7742bd2e75ef670dac31a46d270a96ee28c20639
2015-12-13 19:49:22 +03:00
Leo Yuriev
b848f5552f mdbx: pull CHANGES from LMDB.
Change-Id: I937ca30a04f8dfc2fb923ccb440da2e497185ca3
2015-12-13 19:48:44 +03:00
Leo Yuriev
297d9e71ac mdbx: Merge branch 'tsan-cleanup' into devel.
Some work as a part of https://github.com/ReOpen/ReOpenLDAP/issues/62
2015-12-13 19:41:19 +03:00
Leo Yuriev
886fa96a5d mdbx: tsan 'edge-mutex'.
Change-Id: If6fe58d9e1e334fbdaec529a14a78f5ebc6d8103
2015-12-13 19:41:08 +03:00
Leo Yuriev
24449c2a07 mdbx: avoid tsan-trap in mdb_txn_renew0() by me_live_reader.
Change-Id: I70f173d3e77c9cc84881c86e8fc64ae2a4906f0b
2015-12-13 19:41:07 +03:00
Leo Yuriev
f38bb9621f mdbx: avoid tsan-trap in mdb_find_oldest().
Change-Id: Icaaf032fd3600b2ee61feb39d32af60c4e3bb0d5
2015-12-13 19:41:07 +03:00
Leo Yuriev
75ab3716fb mdbx: avoid tsan-trap in mdbx_txn_straggler().
Change-Id: Ib62cdd5592e6001a1734c321f3801722e4dcf7e4
2015-12-13 19:41:07 +03:00
Leo Yuriev
4e5d5ef935 mdbx: avoid tsan-trap in mdb_meta_head_r().
Change-Id: I594c13e1fe908f8afdc663d349cfc4cf634bba77
2015-12-13 19:41:07 +03:00
Leo Yuriev
5bc0a76899 mdbx: avoid tsan-trap in mdb_txn_renew0() by mti_txnid.
Change-Id: Ia91bb913fc99880ec34fd0bf6fc9396555c6a56f
2015-12-13 19:41:07 +03:00
Leo Yuriev
50c480e2de mdbx: avoid tran-trap in mdb_txn_renew0() by mt_flags.
Avoid read txn-flags from shared write TXN (e.g. env->me_tnx0->mt_flags)
without holding a write-mutex.

Change-Id: I3a3a64597f69b7df205043c567a51fe509247826
2015-12-13 19:41:07 +03:00
Leo Yuriev
6069149b05 mdbx: basic support for ThreadSanitizer (tsan).
Change-Id: Ia23751ac569b64e94cd6f5e6910f77a203259fa3
2015-12-13 19:41:07 +03:00
Leo Yuriev
dec88f8c35 mdbx: fix double-free on thread-destroy.
Seems this is fixes the https://github.com/ReOpen/ReOpenLDAP/issues/60

Change-Id: I29830a1b9cec0285edc976e6892678cd38e4445c
2015-12-13 19:40:58 +03:00
Leo Yuriev
2d2a3ebcfb mdbx: add missing h-deps into Makefile.
Change-Id: Ia3af98e4194b7bfb43973069a634c4c0fb011d5c
2015-12-13 17:58:23 +03:00
Leo Yuriev
a0d056e47e mdbx: less mad in the Makefile.
Change-Id: Iec6a7546424b1e2954cd3c21805ddf01cc77d93e
2015-12-01 18:45:18 +03:00
Leo Yuriev
a7a28ecdb4 mdbx: Release 0.9.17 (pull from openldap.org).
Change-Id: Ia92368fc1e17c4106cffe72c7a34581d4413e8ca
2015-12-01 16:05:55 +03:00
Leo Yuriev
28caf0dde5 mdbx: Merge branch 'devel' into master. 2015-11-26 14:03:22 +03:00
Heiko Becker
1739a2f4c1 mdbx: backport - ITS#8169 Allow passing mandir to make install.
The motivation for this change is my distribution moving to a multiarch
layout. While the architecture specific stuff (binaries, libraries,
etc.) is installed under /usr/${host}/{bin,lib,...} architecture-independent
data should still be installed to /usr/share/.

Change-Id: I9bc1e4ba975e8ef7fe945ca3b30f044ac40eedf2
2015-11-25 19:08:48 +03:00
Leo Yuriev
35452812b5 mdbx: pull CHANGES from LMDB.
Change-Id: Id85578ea842564792dd7141984b67406fa5a804c
2015-11-25 19:08:34 +03:00
Howard Chu
d0a0b096ee mdbx: backport - Cleanup C_DEL flag usage.
Only set it if the cursor's current position was deleted

Change-Id: I4c4c2fa157b73042419cb7b7e39e280a1eca155a
2015-11-25 19:08:26 +03:00
Leo Yuriev
2a6bfa56f0 mdbx: backport - more for cursor tracking.
Includes:

 - ITS#8321 deinit empty cursors
   Always unset C_INIT flag if the cursor's target DB has been deleted

 - ITS#8321 Fix mdb_cursor_set
   Always reinit mc_pg[0] if cursor is not C_INITIALIZED
   It might have a stale value when using nested txns

 - ITS#8321 mdb_put cursor needs tracking too

 - ITS#8321 page_touch - don't fixup the cursor we just touched

 - ITS#8321 More cursor fixup
   Based on page_touch fixup from ITS#7594 but expanded:
   make sure sub-cursors agree with main cursors.

 - ITS#8321 cleanup unused var

Change-Id: I4b825e20e9d42d3166052e9b3e5bd0ac33b70e85

ITS#8321 fix ambiguity in cursor_put fixup

After delete/add of a node, other nodes may no longer be
pointing at the data they intended. This can confuse subsequent
fixups.

Change-Id: Id43406a9828b440735835b024e94e9b2d5a17693
2015-11-25 19:08:14 +03:00
Howard Chu
3eb38d2f1b mdbx: backport - ITS#8323 Fix nested commit.
Must remove our spilled pages from parent's dirty list

Change-Id: Ic37bcea4975801e48832968ea38050064a581d21
2015-11-25 18:39:31 +03:00
Hallvard Furuseth
3e74ab2aee mdbx: backport - CURSOR_TMP_[UN]TRACK() -> WITH_CURSOR_TRACKING().
Change-Id: I008b7db829765889fd63900b802f57eca0c6cd20
2015-11-25 18:09:11 +03:00
Leo Yuriev
6e1ba1cf28 mdbx: Merge branch 'devel' into master. 2015-11-23 10:19:33 +03:00
Orivej Desh
5d4a23138c mdbx: backport - ITS#8320 mdb_load: fix loading data from simple text files.
mdb_load -T was supposed to read escaped text,
but 21b51cb7 "Add mdb_load" made it read hex.

Change-Id: If12a01ee897af0570d95744626815c535cc81f9f
2015-11-23 10:13:05 +03:00
Orivej Desh
a8e2288537 mdbx: backport - ITS#8319 mdb_load: explain readline and mdb_cursor_put errors.
Change-Id: I99e8ff220bb37109da83bb6088be7597b52c6f00
2015-11-23 10:13:05 +03:00
Leo Yuriev
aeea7ebb08 mdbx: backport - ITS#8321 a lot for cursor tracking.
Multiple bugs were fixed in the cursor fixups which
adjust other open cursors in response to various write ops.

Includes:

 - ITS#8321 Fix del/dupsort.
   When deleting a dupsort key, if other cursors pointed at that key,
   set them to uninit'd, not EOF. They no longer have anything to
   point at.

 - ITS#8321 don't skip fixups on splitting cursors.
   Adjustments can't be skipped, in recursive calls each level must
   fixup their own level.

 - ITS#8321 fix mdb_cursor_chk().
   It was reporting spurious errors due to uninit'd cursors

 - ITS#8321 fix mdb_cursor_shadow().
   Set a valid txn so that cursor fixup code works on the shadows

 - ITS#8321 fix mdb_cursor_put.
   Ignore sub-cursors that shouldn't be fixed up

 - ITS#8321 track temporary cursors.
   In rebalance/split operations, temporary cursors need to be visible
   to propagate fixups

 - ITS#8321 simplify page_split fixups.

 - ITS#8321 reorganize page_split fixups.
   DUPFIXED fixups needed to occur after separator update.
   MDB_RESERVE handling moved after split fixup.

Change-Id: I0c04acf54ebf6e84f32996b5723ec6fafb983ad9
2015-11-23 10:09:20 +03:00
Howard Chu
0a97fbcbab mdbx: backport - ITS#8300 more for prev commit.
Just tell explicitly which direction we moved/merged from

Change-Id: Ib1868003d30f3afe71f105c2750253bbc6059610
2015-11-23 10:07:49 +03:00
Howard Chu
2154b585c6 mdbx: backport - Silence some valgrind uninit warnings.
Change-Id: Ie26d7bd08a3a4d4ceb833093a9117f1ebaca6cb0
2015-11-23 10:07:49 +03:00
Howard Chu
90fdef7a6a mdbx: backport - Refix root split check from 5da67968afb599697d7557c13b65fb961ec408dd.
Change-Id: If012ddcf223a3312bbe13c4b24d776b488ed3772
2015-11-23 10:07:49 +03:00
Howard Chu
6ba0b8b467 mdbx: backport - ITS#8316 cursor fixup in page_merge.
Deleting the merged page requires bumping down other ki's
of the page's parent.

Change-Id: Ifc94e26b8755ede2400521556556a6824bc2c62b
2015-11-23 10:07:49 +03:00
Leo Yuriev
bf81e86d93 mdbx: prevents use the env after a fork().
Change-Id: I9c86500ac008a7be7eb16aeff2610fa5cfa22b84
2015-11-22 17:48:30 +03:00
Howard Chu
7e2000ef7a mdbx: backport - ITS#8315 fix ovpage_free.
Keep dirty_room sync'd with dirty_list

Change-Id: I9e52a72df95ffb504740e8daecf65b62970e9f25
2015-11-19 20:44:49 +03:00
Howard Chu
12cd2361e7 mdbx: backport - ITS#8313 more for ITS#8062.
dummy flags must be init'd due to 3d46d550

Change-Id: I3d543bd3e059da9b007f1e752f20171acc183679
2015-11-19 20:44:44 +03:00
Hallvard Furuseth
86abc397e8 mdbx: backport - ITS#8312 Fix loose pages in commit(nested txn).
Change-Id: Ie335dcff0c87cfc13abf9b937f5d058d3ea9d841
2015-11-19 20:44:13 +03:00
Leo Yuriev
f3043badc5 mdbx: tools/tests - fix minor memleaks (for CI with Valgrind).
Change-Id: I0e2217d568259f26cd7c4da800a13577962742f7
2015-11-19 19:05:02 +03:00
Leo Yuriev
0230e4fda2 mdbx: clarify fsync/fdatasync comment.
Change-Id: I2209b5e65ca8c04ff2de9b1b789f1993f24ab454
2015-11-19 19:05:02 +03:00
Howard Chu
02da85169e mdbx: backport - ITS#8311 fix page_split from update_key.
Check for top of stack. Usually the cursor only has height 1 when
calling page_split, but not always.

Change-Id: Iad221be30edac0f82b650f787e5dbe721cc978e0
2015-11-19 19:05:02 +03:00
Leo Yuriev
4bdeed9bd3 mdbx: fix thread-local-storage memleak.
This fix a TLS-memleak for thread from which mdbx_env_close_ex()
has been called. Bug was added by while fixing the
https://github.com/ReOpen/ReOpenLDAP/issues/48

In general we should explicitly free(), because
pthread_key_delete() don't calls a destructor.

Change-Id: Ic55a2348caf3be34b4331d5ad101ea33dbbdfa97
2015-11-19 19:05:02 +03:00
Leo Yuriev
cee258fe86 mdbx: fix uninit fields in page_malloc().
Change-Id: I35a162d6b391d33eda4d508e9c1af7238b33665d
2015-11-19 19:05:02 +03:00
Leo Yuriev
fed7922b30 mdbx: link tools librt.so with --no-as-needed.
Change-Id: I9c5096320b264aa14f1905d15e9bd495087d1bb9
2015-11-14 13:42:44 +03:00