Commit Graph

114 Commits

Author SHA1 Message Date
Howard Chu
380c61bcf7 mdbx: backport - ITS#8310 fix mdb_rebalance cursor fixup.
When collapsing root, must adjust entire cursor stack

Change-Id: If62c42f556311e785aa414954a3d7fddc077cf62
2015-11-14 13:07:19 +03:00
Howard Chu
ab0b0ec7ce mdbx: backport - ITS#8304 fix page_merge (mdb_del cursor tracking).
Was using the pre-touch dst page pointer instead of the touched page

Change-Id: Ib41af356dcf883b923dbfbbc7591a02483ee54dd
2015-11-10 09:12:33 +03:00
Howard Chu
ee26517b5d mdbx: backpost - ITS#8300 fix rebalance after node_move.
ITS#8258, ITS#7829 fixes checked parent index to see if we were moving
from a left neighbor. Should have just checked to see if current index
was 0, meaning we added on the left. (Parent index may not tell us
anything meaningful after a nested rebalance.)

Includes:

 - ITS#8300 fix node_move
   Don't adjust other cursors when we added a node on the right.

 - ITS#8300 more for node_move fixups
   When moving a node from the right neighbor, a different
   adjustment is needed.

 - ITS#8300 simplify

 - ITS#8300 more for node_move
   When moving a node from one page to another, make sure other cursors'
   parent index gets adjusted too.
2015-11-06 17:46:51 +03:00
Howard Chu
7890eb8a8e mdbx: backport - ITS#8238 fix DUPFIXED page_split.
Parent mc_ki wasn't adjusted if new_indx was > split point

Change-Id: I45548e378e53bad5ce7a3a7c2b8236d592f3c412
2015-11-06 17:46:31 +03:00
Howard Chu
f35fb03f86 mdbx: backport - ITS#8299 fix page_merge cursor fixup.
The parent's mc_ki has changed. We need to fix that up as well
in other cursors.

Change-Id: I1f422a07ed75b99f3e36075749800c892ca6d5ec
2015-11-06 17:46:31 +03:00
Leo Yuriev
b430c9a22f mdbx: Add MDB_USE_ROBUST to control Robust Mutexes.
Backported from origin.

Change-Id: I416c1d09fb1f290423f29a84831accdaf4436ab0
2015-11-06 17:26:41 +03:00
Leo Yuriev
a542ceeae5 Merge branch 'master' into devel 2015-11-06 16:27:59 +03:00
Leo Yuriev
c6e010a872 mdbx: fix segfault on close when open failed. 2015-10-31 13:56:12 +03:00
Leo Yuriev
60387be4a5 Merge branch 'master' into devel 2015-10-21 00:24:44 +03:00
Leo Yuriev
dc3256e91c mdbx: adds signatures to detect ABI mixup. 2015-10-20 23:59:06 +03:00
Howard Chu
ad808146c8 lmdb: ITS#7771 fix cursor tracking on fake pages.
node_del shifts nodes around, cursors pointing at fake pages
need to have their mc_pg[0] corrected.

Includes ITS#7771 more for prev commit.
2015-10-19 16:07:03 +03:00
Howard Chu
f6045ae77e lmdb: ITS#8263 fix cursor tracking in cursor_put.
Includes ITS#8263 streamline prev patch.
2015-10-19 16:06:28 +03:00
Leo Yuriev
68171d5f5d lmdb: provide both interfaces - advanced 'mdbx' and original 'lmdb'. 2015-10-13 23:50:25 +03:00
Leo Yuriev
09c140c1f4 lmdb: detach from ReOpenLDAP project. 2015-10-12 20:01:16 +03:00
Howard Chu
73cfae2522 lmdb: ITS#8264 fix cursor_del cursor tracking.
Some destination fixups need to happen immediately after nodes
are moved, before rebalancing

Change-Id: Ia4258cae368ff0ef96b7835cc421f2db40f7f741
2015-10-11 22:21:37 +03:00
Howard Chu
f2d0824bdb lmdb: ITS#8258 fix rebalance/split.
The tree height can also increase during rebalance, not just shrink.
This can happen if update_key needs to split a parent branch page.

Change-Id: Ie232bd9f4a6225b912b912a68f0b35411a632317
2015-10-06 10:13:27 +03:00
Hallvard Furuseth
305ba98967 lmdb: Fix typo in mdb_tassert().
No effect on current code.

Change-Id: Ia935ba784c33e3704ea1cfa1d59a1f28d2c527f8
2015-10-06 10:11:18 +03:00
Howard Chu
ef72fbaea6 lmdb: ITS#8221 don't merge branch pages needlessly.
Change-Id: I6b535f70392e081027d8803b6623b0c51f21ec8b
2015-10-06 10:05:46 +03:00
Leo Yuriev
8e2a9a9a78 lmdb: deferred cleanup of reader's threads.
This should fix https://github.com/ReOpen/ReOpenLDAP/issues/48

Change-Id: I67feb3a9852f183dcbe83626321896ba43a591b7
2015-09-07 02:38:10 +03:00
Howard Chu
83ba70e3be lmdb: ITS#8237 fix ITS#7589 regression.
Change-Id: Idd3c95f6e515f0f70c7fd33257c80354a3953f2f
2015-09-06 22:57:01 +03:00
Leo Yuriev
4554b8f62c all: fix build by clang (defines, warnings).
Conflicts:
	contrib/slapd-modules/usn/usn.c

Change-Id: I68572808e30a35fdd14aa0a459cfbb8da4be6dc5
2015-09-05 18:35:32 +03:00
Leo Yuriev
16a30be8fc lmdb: minor refine mdb_chk output,
mostly for 'zero size-of-entry' error.

Change-Id: I0f7ae514860ea05179fd929b76f78ba843902e92
2015-09-03 17:26:23 +03:00
Leo Yuriev
07ee471b1c lmdb: me_maxkey_limit always computed and checked against MDB_MAXKEYSIZE at opening env.
Change-Id: Ice0a425900a8c7b37d5b6cfcd1434edc8d400a74
2015-09-02 18:08:43 +03:00
Leo Yuriev
f7d8812e6c lmdb: n-entries info from b-tree traversal in mdb_chk.
Change-Id: Ic9343dcdba976ac51c8f5776d2f7c9fed59da8e0
2015-09-02 17:53:48 +03:00
Leo Yuriev
15e0600b6c lmdb: major rework of traversal b-tree for mdb_chk.
Change-Id: I9d382516f76092f44fc1a12d7554039582b87656
2015-09-02 16:19:12 +03:00
Leo Yuriev
e7f58da2ac lmdb: support for a utterly no-sync mode,
by combination of MDB_NOSYNC and MDB_MAPASYNC.

Change-Id: I3e2d6c8f044a7522436dab4d0818d4d59b78b78d
2015-09-01 12:15:59 +03:00
Hallvard Furuseth
e4d9f0a905 lmdb: ITS#7377 catch calloc error in mdb_env_init_meta().
Change-Id: I2b1a4ec9f86a3a7844b157863d18ce81be400cef
2015-08-30 01:02:43 +03:00
Leo Yuriev
6a3efb82eb lmdb-test: workaround for MDB_FIXEDMAP to avoid sporadic failures.
Change-Id: I6ba993ff50956d328fd76326c67aa83dff20ce48
2015-08-24 03:37:05 +03:00
Leo Yuriev
537fc0fe1a lmdb: simple write benchmark.
Change-Id: Iadcbe8ad5922b2ecf1ea597b188ef368bc097185
2015-08-24 03:36:55 +03:00
Leo Yuriev
00d2057204 lmdb: fix rare MDB_MAP_FULL when pages are available in the gc.
Rework preparation backlog of available pages for cleanup FreeDB.
https://github.com/ReOpen/ReOpenLDAP/issues/42

Change-Id: I47592b4cabf1950e61bb87e67c08ea03e95496fa
2015-08-20 19:26:20 +03:00
Leo Yuriev
b8c45546f6 lmdb: more likely/unlikely hints.
Change-Id: I38f1f80243bfc5b1ffe910175516dbb3f06c27ba
2015-08-15 13:17:46 +03:00
Leo Yuriev
ad8c4a19bb lmdb: fix segfault in mdb_chk when mdb_env_open() failed.
Change-Id: If72d35518c2d4dd33d284049e00fc633e65ee52c
2015-08-13 18:30:03 +03:00
Leo Yuriev
96d69e3fa1 lmdb: added mdb_env_open_ex() and exclusive/monopoly mode for mdb_chk.
Change-Id: I867e7f17924ffecb744440e95db96c0a7411d6ef
2015-08-13 18:30:02 +03:00
Leo Yuriev
1171e4d73a lmdb: fix build non-debug mode (MDB_DEBUG=0).
Change-Id: I362a6bd03c73dca70bc6df5f72badf59e560389a
2015-08-06 17:13:25 +03:00
Leo Yuriev
3fc45cbaea lmdb: fix assertion failure in case error while opening DB in debug-mode.
Change-Id: I56a1122369640920d594416e9bd3de0f3f9cd8fd
2015-08-05 22:59:18 +03:00
Leo Yuriev
595f9e700d lmdb: fix b-tree walking bug in case empty db.
Change-Id: I28c0985493327babe4d2ae5c6cd56116a26e6034
2015-08-05 22:59:18 +03:00
Leo Yuriev
a243a38aa6 lmdb: adding page-space usage info to mdb_chk.
Change-Id: I12dcdb54894a362d41612e973f983cb4e067520c
2015-08-05 22:59:18 +03:00
Leo Yuriev
c32cf0fea4 lmdb, back-mdb: use 'long' as result to speedup comparison.
Change-Id: I3ade0c7525f4a461a7edf5873af196e6b33c0727
2015-08-05 14:35:09 +03:00
Leo Yuriev
b60f510355 lmdb: rework key/data comparison to avoid alignment errors.
Change-Id: I291b50ad6f7dd18f6cbdef34028d917e10166cf1
2015-08-05 00:45:57 +03:00
Hallvard Furuseth
c9a8595ef2 lmdb: Kill magic numbers for NUM_METAS, databases.
Change-Id: I7ed12f081aed7eb65087fea511053157fb8f9c1e
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
061fe51e8c lmdb: ITS#7377 Catch mdb_put() to blocked/read-only txns.
...early enough that txn state is left unchanged.

Change-Id: Ia475660f339f7b741eaaa126978f8419a19b67a0
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
d6b3c6f710 lmdb: ITS#7377 Always notice env error on txn startup.
Move the check to the end of txn startup.  Catches env
breakage which happens while the new txn waits for a lock.

Change-Id: I074d411cd5339b5e6caa2691078ea07b0d49828e
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
11999c8c02 lmdb: Cleanup, Drop !mt_dbxs hack, use MDB_TXN_FINISHED.
Change-Id: I23beaaf931c938ee9f3886ca1928ecbcd2fbe5ba
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
342d56977f lmdb: Catch most uses of finished/parent txns.
* Add MDB_TXN_FINISHED, MDB_TXN_HAS_CHILD, MDB_TXN_BLOCKED.
* Clear mt_numdbs in writers, for TXN_DBI_EXIST() to catch.
  We already do in readers.

Change-Id: I4f714c0789188dfab4ce22b7d9d3a75d8b62ef6b
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
e3c8fa8eba lmdb: Move code into mdb_txn_end(). Was mdb_txn_reset0.
Side effects:
* Clean txn up a bit even before freeing it.
* Tweak DEBUG output at txn end. Add DEBUG after commit(writer).

Change-Id: Ia9905257893923bb14cdf33b60b6387af3121f81
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
23af429b3f lmdb: ITS#8200 Fix mdb_midl_shrink() usage, return void.
Change-Id: I506a170d434178d43f01b3e9597c4a03b3b3e7a7
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
862cfc30c4 lmdb: Simpler mdb_node_add().
Change-Id: I5b1f851a098aeb4b5adcd7ed55150a055cd63102
2015-08-04 13:57:14 +03:00
Hallvard Furuseth
be27186f76 lmdb: ITS#8181 Verify that records are/aren't DBs.
Except we don't catch the user passing F_SUBDATA to
mdb_cursor_<put/del>, like an internal LMDB call.

Change-Id: I5ebce36694045279702c74490a5a634217d4f95d
2015-08-04 13:57:13 +03:00
Howard Chu
91a6b6de57 lmdb: ITS#8190 fix cursor EOF bug.
Change-Id: I97556bc521e1d4d4ea9f3e43c14a8a2fe62b8231
2015-08-04 13:57:13 +03:00
Hallvard Furuseth
96fb8eec8a lmdb: More ESECT declarations.
Change-Id: Iaed5c6e35b1bd6e59caf8d1f52b265ec4852c84a
2015-08-04 13:57:13 +03:00