]> git.sur5r.net Git - openldap/log
openldap
11 years agoITS#7594 more for subDB cursor fix
Howard Chu [Wed, 5 Jun 2013 23:13:43 +0000 (16:13 -0700)]
ITS#7594 more for subDB cursor fix

11 years agoITS#7594 better fix
Howard Chu [Wed, 5 Jun 2013 22:23:54 +0000 (15:23 -0700)]
ITS#7594 better fix

Update the subDB cursor, don't invalidate it

11 years agotweak mdb_copy, trap signals
Howard Chu [Thu, 30 May 2013 22:56:30 +0000 (15:56 -0700)]
tweak mdb_copy, trap signals

11 years agoWindows portability fixes for prev commit
Howard Chu [Thu, 30 May 2013 22:33:59 +0000 (15:33 -0700)]
Windows portability fixes for prev commit

11 years agoAdd warning about interrupting copy
Howard Chu [Thu, 30 May 2013 20:13:33 +0000 (13:13 -0700)]
Add warning about interrupting copy

11 years agoFix prev commit
Howard Chu [Thu, 30 May 2013 20:09:28 +0000 (13:09 -0700)]
Fix prev commit

11 years agoAdd mdb_env_copyfd()
Howard Chu [Thu, 30 May 2013 20:06:12 +0000 (13:06 -0700)]
Add mdb_env_copyfd()

Allow writing backup to an already opened file handle, for piping
to tar/gzip/ssh/whatever.

11 years agoAdd _M_IX86 macro for MSVC
Howard Chu [Sat, 25 May 2013 17:16:55 +0000 (10:16 -0700)]
Add _M_IX86 macro for MSVC

11 years agoITS#7594 De-init other subcursors in page_touch
Howard Chu [Thu, 23 May 2013 15:13:08 +0000 (08:13 -0700)]
ITS#7594 De-init other subcursors in page_touch

11 years agoDrop unused liblmdb MIDL-range support.
Hallvard Furuseth [Tue, 21 May 2013 21:58:57 +0000 (23:58 +0200)]
Drop unused liblmdb MIDL-range support.

11 years agoFactor out mdb_find_oldest,mdb_dlist_free,dirty_list.
Hallvard Furuseth [Tue, 21 May 2013 21:55:13 +0000 (23:55 +0200)]
Factor out mdb_find_oldest,mdb_dlist_free,dirty_list.

Do not rescan reader table (mdb_find_oldest) after "goto again".
Skip clearing dirty_list[nonzero].mid in mdb_dlist_free(); it
was not done in mdb_reset0() anyway.

11 years agomdb_stat cleanup.
Hallvard Furuseth [Tue, 21 May 2013 21:48:27 +0000 (23:48 +0200)]
mdb_stat cleanup.

Exit with success when there was no failure.
Do not use data containing NUL as a DB name (which is a C string).

11 years agoITS#7598 Tweak MDB_<NEXT/PREV>_NODUP,fix mdb_stat.
Hallvard Furuseth [Tue, 21 May 2013 20:44:51 +0000 (22:44 +0200)]
ITS#7598 Tweak MDB_<NEXT/PREV>_NODUP,fix mdb_stat.

MDB_NEXT_NODUP, MDB_PREV_NODUP: Allow for non-MDB_DUPSORT databases.
No mdb.c code changes needed.

mdb_stat.c: Use MDB_NEXT_NODUP, to avoid a crash with a DUPSORT mainDB.

11 years agoITS#7598 mdb_dbi_open(named DB): Check mainDB flags.
Hallvard Furuseth [Tue, 21 May 2013 17:04:52 +0000 (19:04 +0200)]
ITS#7598 mdb_dbi_open(named DB): Check mainDB flags.

Reject attempts to open named databases if the main
database has flag MDB_DUPSORT or MDB_INTEGERKEY.

DUPSORT would require an xcursor for the DB, INTEGERKEY
would expect the DB name to be a binary integer.

11 years agoITS#7515 Fix nested txn touch of subpage/ovpage.
Hallvard Furuseth [Mon, 20 May 2013 21:12:52 +0000 (23:12 +0200)]
ITS#7515 Fix nested txn touch of subpage/ovpage.

mdb_page_touch(): Don't touch a subpage, replacing with non-subpage.
mdb_cursor_put(): Don't overwrite ancestor txn's dirty overflow page.

11 years agoTweak mdb_page_malloc(),mdb_page_get() semantics.
Hallvard Furuseth [Mon, 20 May 2013 21:12:26 +0000 (23:12 +0200)]
Tweak mdb_page_malloc(),mdb_page_get() semantics.

mdb_page_malloc(): Add "number of pages" parameter.
mdb_page_get(): Add output param for how page was found.
Do not set return params on error.
mdb_cursor_put(): Catch mdb_page_get() error.

Prepares for next commit, no change in caller behavior other
than on mdb_page_get error.

11 years agoMore ITS#7589 followup: OVPAGES() -> mp_pages.
Hallvard Furuseth [Sun, 19 May 2013 17:08:07 +0000 (19:08 +0200)]
More ITS#7589 followup: OVPAGES() -> mp_pages.

11 years agoMore ITS#7589: Fix prev commit.
Hallvard Furuseth [Sun, 19 May 2013 16:38:13 +0000 (18:38 +0200)]
More ITS#7589: Fix prev commit.

mp_pages gives #pages in the ovpage. OVPAGES() no longer does.

11 years agoITS#7589 mdb_cursor_put(): Update ovpage nodesize.
Hallvard Furuseth [Fri, 17 May 2013 17:31:17 +0000 (19:31 +0200)]
ITS#7589 mdb_cursor_put(): Update ovpage nodesize.

Update the nodesize when overwriting an overflow page.
As before, do not attempt to shrink the page.

11 years agoInclude <netinet/in.h> for Solaris 8
Howard Chu [Wed, 15 May 2013 18:50:40 +0000 (11:50 -0700)]
Include <netinet/in.h> for Solaris 8

Needed for <resolv.h>, which is needed for BYTE_ORDER.

11 years agoFix mdb_page_split - nested split
Howard Chu [Tue, 14 May 2013 23:57:50 +0000 (16:57 -0700)]
Fix mdb_page_split - nested split

If updating a page's separator triggers a split in its parent,
we may have missed adjusting the parent's cursor position.

11 years agoDoxygen cleanup
Howard Chu [Mon, 13 May 2013 19:36:47 +0000 (12:36 -0700)]
Doxygen cleanup

11 years agoFix 66c839f0292d9aea12bf93ef6568ac2bd2ca0fc8
Howard Chu [Fri, 10 May 2013 12:56:16 +0000 (05:56 -0700)]
Fix 66c839f0292d9aea12bf93ef6568ac2bd2ca0fc8

Forgot #include <errno.h>

11 years agoRefactor mdb_midl_append, add mdb_midl_grow()
Howard Chu [Fri, 10 May 2013 00:27:29 +0000 (17:27 -0700)]
Refactor mdb_midl_append, add mdb_midl_grow()

11 years agoITS#7515 Fix nested transaction error handling.
Hallvard Furuseth [Sun, 5 May 2013 13:13:31 +0000 (15:13 +0200)]
ITS#7515 Fix nested transaction error handling.

mdb_txn_begin(): Do not free(mt_free_pgs), it needs mdb_midl_free().
mdb_txn_commit(): Catch commit(child) error.

11 years agoFix mdb_env_close(unopened MDB_env).
Hallvard Furuseth [Sun, 5 May 2013 12:26:05 +0000 (14:26 +0200)]
Fix mdb_env_close(unopened MDB_env).

Do not try to scan me_dbxs in a closed/never-opened MDB_env.
Broken by 7d643d3acb94a6d7306330b550fce0e5755444a9
and 151c416b460b02cd96502a47189cda19ab651ada.

11 years agoSimplify/cleanup mdb_cursor_init, C_ALLOCD.
Hallvard Furuseth [Sat, 4 May 2013 10:53:43 +0000 (12:53 +0200)]
Simplify/cleanup mdb_cursor_init, C_ALLOCD.

No real change.
mdb_cursor_init() checks if it needs mx, so pass it unconditionally.
Set C_ALLOCD for shadow cursors, for clarity. (It was always set as
it should anyway from the origin cursor, which would have C_ALLOCD.)

11 years agoMDB warning cleanup.
Hallvard Furuseth [Sat, 4 May 2013 10:41:28 +0000 (12:41 +0200)]
MDB warning cleanup.

Unused function when MDB_DEBUG. Unused 'excl' param.

11 years agomdb_dcmp(): Assume the database has MDB_DUPSORT.
Hallvard Furuseth [Sat, 4 May 2013 10:34:49 +0000 (12:34 +0200)]
mdb_dcmp(): Assume the database has MDB_DUPSORT.

There was little point in returning EINVAL when not: Comparing (A,B)
and (B,A) would claim (A > B && B > A), which could confuse callers.

11 years agoUpdate MDB doc: Cursors, DB handles, data lifetime
Hallvard Furuseth [Sat, 4 May 2013 10:34:20 +0000 (12:34 +0200)]
Update MDB doc: Cursors, DB handles, data lifetime

11 years agoAllow mdb_cursor_close() after readonly txn ends.
Hallvard Furuseth [Sat, 4 May 2013 10:34:02 +0000 (12:34 +0200)]
Allow mdb_cursor_close() after readonly txn ends.

Catch mdb_cursor_renew(write txn's cursor).  Add flag C_UNTRACK, so
mdb_cursor_close need not peek inside a possibly-freed readonly txn.

11 years agoClose cursors when commit(writer). Factor out code.
Hallvard Furuseth [Sat, 4 May 2013 10:33:06 +0000 (12:33 +0200)]
Close cursors when commit(writer). Factor out code.

Close remaining cursors when committing a write txn. The doc says this
happens, and it avoids cursor tracking when updating mainDB + freeDB.

Rename mdb_cursor_merge() -> mdb_cursors_close() for code reuse,
and add a merge option.  Simplify its loop a bit.

Factor out cleanup of DBIs.

11 years agoPlug txn leak and MDB_NOTLS slot leaks on error.
Hallvard Furuseth [Sat, 4 May 2013 10:31:31 +0000 (12:31 +0200)]
Plug txn leak and MDB_NOTLS slot leaks on error.

On mdb_env_copy() error: Abort the txn.
On mdb_txn_renew0() error: Release new MDB_NOTLS reader slot.

11 years agoCleaner "Support mdb_txn_abort(a reset txn)".
Hallvard Furuseth [Sat, 4 May 2013 08:03:19 +0000 (10:03 +0200)]
Cleaner "Support mdb_txn_abort(a reset txn)".

Redo 8a562f560edcc6417672df453c4e626dfb4c4024 so !mt_dbxs indicates
"txn was reset", so mt_numdbs gets one magic value instead of two.

11 years agoUpdate fixes for dbi_open/close, ITS#7515.
Hallvard Furuseth [Sat, 4 May 2013 08:03:19 +0000 (10:03 +0200)]
Update fixes for dbi_open/close, ITS#7515.

Reset me_dbflags[dbi] when closing DBI, to get rid of MDB_VALID flag.
mdb_env_close(): Re-fix DB-name memleak. DBIs > me_numdbs may exist.

11 years agoAllow reading freelist while working on it
Howard Chu [Thu, 2 May 2013 05:43:35 +0000 (22:43 -0700)]
Allow reading freelist while working on it

The circular dependency issues appear to have been resolved.
Still, need to watch closely, maybe revert this change if
problems arise.

11 years agoAvoid assert
Howard Chu [Wed, 1 May 2013 04:09:09 +0000 (21:09 -0700)]
Avoid assert

Due to underfilled branch page. We're in the process of merging/moving
nodes to it because we already know it's underfilled. Took this approach
rather than just removing the assert in mdb_page_search_root, because
that assert may yet catch other situations we don't know about.

(Although, it has been there since the original commit of mdb.c and
has never triggered any other times...)

11 years agoPlug mdb_cursor_renew() memleak
Hallvard Furuseth [Mon, 22 Apr 2013 18:46:56 +0000 (20:46 +0200)]
Plug mdb_cursor_renew() memleak

11 years agoFix MDB_LAST, reset cursor index
Howard Chu [Sun, 21 Apr 2013 02:30:06 +0000 (19:30 -0700)]
Fix MDB_LAST, reset cursor index

11 years agoFix typo from 7aba5f5ab92a3fa92de001edb2c5ff4b04fd7d0d
Howard Chu [Sat, 20 Apr 2013 16:47:33 +0000 (09:47 -0700)]
Fix typo from 7aba5f5ab92a3fa92de001edb2c5ff4b04fd7d0d

11 years agoTweak comments/readability.
Hallvard Furuseth [Thu, 18 Apr 2013 06:00:03 +0000 (08:00 +0200)]
Tweak comments/readability.

Show MDB_PERSISTENT/MDB_VALID/DB_VALID relationship.
mdb_txn_renew0(): Remove obsolete "cannot fail" comment.

11 years agoAdd MDB_NOTLS envflag.
Howard Chu [Thu, 18 Apr 2013 02:17:03 +0000 (04:17 +0200)]
Add MDB_NOTLS envflag.

11 years agoCatch MDB txn reuse/sync errors.
Hallvard Furuseth [Thu, 18 Apr 2013 02:16:07 +0000 (04:16 +0200)]
Catch MDB txn reuse/sync errors.

11 years agoSupport mdb_txn_abort(a reset txn).
Hallvard Furuseth [Thu, 18 Apr 2013 02:15:45 +0000 (04:15 +0200)]
Support mdb_txn_abort(a reset txn).

11 years agoCleanup for TLS key and read-only filesystem.
Hallvard Furuseth [Thu, 18 Apr 2013 02:15:13 +0000 (04:15 +0200)]
Cleanup for TLS key and read-only filesystem.

Move key init into mdb_env_setup_locks().
Don't create unused TLS key when read-only filesystem.
Drop internal flag MDB_ROFS, we can instead test either
!me_txns, !mt_u.reader or me_lfd==INVALID_HANDLE_VALUE.

11 years agoClean up MDB_env setup.
Hallvard Furuseth [Thu, 18 Apr 2013 02:13:43 +0000 (04:13 +0200)]
Clean up MDB_env setup.

Malloc before I/O. Avoids possible malloc error after I/O.
Don't allocate dirty & free lists when MDB_RDONLY.
Factor out code.

11 years agoFix mdb_rebalance
Howard Chu [Wed, 17 Apr 2013 21:33:41 +0000 (14:33 -0700)]
Fix mdb_rebalance

Don't do anything with (fake root) subpages

11 years agoITS#7574 blind fix
Howard Chu [Tue, 16 Apr 2013 19:05:03 +0000 (12:05 -0700)]
ITS#7574 blind fix

Fix 227329c8e1fb818548f1936f5dc1349ffd733523, don't persist
the MDB_VALID bit in db.md_flags.

11 years agofix prev commit
Howard Chu [Mon, 15 Apr 2013 16:30:39 +0000 (09:30 -0700)]
fix prev commit

11 years agoFix mdb_rebalance
Howard Chu [Mon, 15 Apr 2013 06:59:54 +0000 (23:59 -0700)]
Fix mdb_rebalance

Need to check NUMKEYS as well as fill threshold, when deciding
whether to change anything. Don't let the page drop below the
minimum number of keys.

11 years agoRevert "ITS#7570 fix MDB_GET_MULTIPLE and MDB_NEXT_MULTIPLE"
Howard Chu [Sun, 14 Apr 2013 23:53:30 +0000 (16:53 -0700)]
Revert "ITS#7570 fix MDB_GET_MULTIPLE and MDB_NEXT_MULTIPLE"

This reverts commit 372b3ddb85bef953fb548fbf2b9ef0cba4e3c8ed.

Original code works as designed.

11 years agoITS#7570 fix MDB_GET_MULTIPLE and MDB_NEXT_MULTIPLE
Claude Brisson [Wed, 10 Apr 2013 12:40:49 +0000 (14:40 +0200)]
ITS#7570 fix MDB_GET_MULTIPLE and MDB_NEXT_MULTIPLE

11 years agoFix 227329c8e1fb818548f1936f5dc1349ffd73352
Howard Chu [Mon, 8 Apr 2013 02:21:46 +0000 (19:21 -0700)]
Fix 227329c8e1fb818548f1936f5dc1349ffd73352

mdb_dbi_close() must allow any dbi < maxdbs, since opens in an
uncommitted txn don't increment env->me_numdbs.

11 years agoRevert "Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e"
Howard Chu [Fri, 5 Apr 2013 10:44:56 +0000 (03:44 -0700)]
Revert "Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e"

This reverts commit 8eef7a4275eda8f2fa2e0d1e67c1d5cbcd91607e.
Previous commit was correct, duplicate keys should not appear here.

11 years agoFixes for dbi_open/close, ITS#7515
Howard Chu [Tue, 2 Apr 2013 18:25:44 +0000 (11:25 -0700)]
Fixes for dbi_open/close, ITS#7515

11 years agoITS#7561 Fix mdb_drop bugs
Howard Chu [Thu, 4 Apr 2013 23:16:25 +0000 (16:16 -0700)]
ITS#7561 Fix mdb_drop bugs

Check for overflow pages, reset cursor position properly.

11 years agoFix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e
Howard Chu [Thu, 4 Apr 2013 14:25:21 +0000 (07:25 -0700)]
Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e

In APPEND don't immediately reject matching key, since this
is valid for APPENDDUP.

11 years agoFix d3990eb2f8b2944782604a2ca7bd52e08c58fc3e
Howard Chu [Thu, 4 Apr 2013 01:26:41 +0000 (18:26 -0700)]
Fix d3990eb2f8b2944782604a2ca7bd52e08c58fc3e

Append mode should *reject* keys that are too small.
Also allow APPENDDUP in mdb_put().

11 years agoFix rebalance when collapsing root page
Howard Chu [Tue, 2 Apr 2013 03:34:40 +0000 (20:34 -0700)]
Fix rebalance when collapsing root page

When fixing other cursors, must also fix their depth.

11 years agoMore fixes for MDB_LAST
Howard Chu [Tue, 2 Apr 2013 02:49:40 +0000 (19:49 -0700)]
More fixes for MDB_LAST

Make sure C_INITIALIZED gets set on successful call

11 years agoITS#7556 fix cursor_sibling for PREV
Howard Chu [Tue, 2 Apr 2013 02:06:05 +0000 (19:06 -0700)]
ITS#7556 fix cursor_sibling for PREV

11 years agoPlug MDB memory leak of DB names.
Hallvard Furuseth [Sun, 31 Mar 2013 21:50:02 +0000 (23:50 +0200)]
Plug MDB memory leak of DB names.

11 years agoSilence signedness warning
Hallvard Furuseth [Sun, 31 Mar 2013 21:48:10 +0000 (23:48 +0200)]
Silence signedness warning

11 years agoFix MDB_DEBUG compile when no varargs macros.
Hallvard Furuseth [Sun, 31 Mar 2013 21:47:45 +0000 (23:47 +0200)]
Fix MDB_DEBUG compile when no varargs macros.

Variables mdb_debug, mdb_debug_start were used undefined.

11 years agoTweak mode_t def per Hallvard's suggestion
Howard Chu [Sun, 31 Mar 2013 19:56:08 +0000 (20:56 +0100)]
Tweak mode_t def per Hallvard's suggestion

11 years agoMSVC doesn't define mode_t
Howard Chu [Sun, 31 Mar 2013 16:10:43 +0000 (08:10 -0800)]
MSVC doesn't define mode_t

11 years agoFix CURSOR_LAST/CURSOR_PREV
Howard Chu [Fri, 29 Mar 2013 08:08:06 +0000 (01:08 -0700)]
Fix CURSOR_LAST/CURSOR_PREV

11 years agoITS#7553 better fix
Howard Chu [Tue, 26 Mar 2013 18:24:59 +0000 (11:24 -0700)]
ITS#7553 better fix

11 years agoITS#7553 deinit cursor after deleting last node
Howard Chu [Mon, 25 Mar 2013 19:15:53 +0000 (12:15 -0700)]
ITS#7553 deinit cursor after deleting last node

11 years agoSilence stupid warnings
Howard Chu [Mon, 25 Mar 2013 18:53:32 +0000 (11:53 -0700)]
Silence stupid warnings

11 years agobugfix for mdb_cursor_put with MDB_MULTIPLE
Claude Brisson [Fri, 22 Mar 2013 15:00:21 +0000 (16:00 +0100)]
bugfix for mdb_cursor_put with MDB_MULTIPLE

If the variable dkey.mv_size is non-zero, then it means dkey
contains some original data which has to be put back in the
child db, typically when the child db has just been created.

But when using MDB_MULTIPLE, if this variable has not been
reset to zero, we may come back to this section and wrongly
think that there is some original data to be taken care of.

11 years agoITS#7538 fallout from ITS#7536 fix.
Howard Chu [Wed, 13 Mar 2013 00:29:34 +0000 (17:29 -0700)]
ITS#7538 fallout from ITS#7536 fix.

Allow leaf pages to have only 1 key.

11 years agoPrecalculate max size of a node
Howard Chu [Wed, 13 Mar 2013 00:25:49 +0000 (17:25 -0700)]
Precalculate max size of a node

11 years agoFix f97552a83abb085bc44b1b578e550d64c1313a4b
Howard Chu [Mon, 11 Mar 2013 17:28:25 +0000 (10:28 -0700)]
Fix f97552a83abb085bc44b1b578e550d64c1313a4b

Causes Bus Error on SPARC

11 years agoCheck for MADV_RANDOM
Howard Chu [Mon, 11 Mar 2013 13:04:54 +0000 (06:04 -0700)]
Check for MADV_RANDOM

Android supports madvise but not posix_madvise

11 years agoITS#7377 Fix c0f3d9b9a8864e744a8d1eaffc99bc86026d5351
Howard Chu [Mon, 11 Mar 2013 12:59:07 +0000 (05:59 -0700)]
ITS#7377 Fix c0f3d9b9a8864e744a8d1eaffc99bc86026d5351

Add missing parens

11 years agoTurn off readahead on main mmap
Howard Chu [Mon, 11 Mar 2013 12:49:14 +0000 (05:49 -0700)]
Turn off readahead on main mmap

It's harmful when the DB is larger than RAM.

11 years agoITS#7536 fix mdb_rebalance
Howard Chu [Wed, 6 Mar 2013 20:30:37 +0000 (12:30 -0800)]
ITS#7536 fix mdb_rebalance

A page must always have at least 2 keys (unless it's a root page)

11 years agoUse CC/LDFLAGS to link the shared lib
Howard Chu [Mon, 25 Feb 2013 13:06:51 +0000 (05:06 -0800)]
Use CC/LDFLAGS to link the shared lib

11 years agoInstall manpages too
Howard Chu [Mon, 25 Feb 2013 10:02:15 +0000 (02:02 -0800)]
Install manpages too

11 years agoDelete obsolete @todo
Howard Chu [Mon, 25 Feb 2013 07:40:34 +0000 (23:40 -0800)]
Delete obsolete @todo

We do it now... (coalescing freelist entries in page_alloc)

11 years agoAdd sample apps for comparison/education purposes
Howard Chu [Mon, 25 Feb 2013 07:39:17 +0000 (23:39 -0800)]
Add sample apps for comparison/education purposes

11 years agoAdd $(DESTDIR) to make install target
Howard Chu [Mon, 25 Feb 2013 06:50:51 +0000 (06:50 +0000)]
Add $(DESTDIR) to make install target

11 years agoUpdate error code instances
Howard Chu [Wed, 20 Feb 2013 13:08:52 +0000 (05:08 -0800)]
Update error code instances

11 years agoTweak MDB_INCOMPATIBLE description
Hallvard Furuseth [Wed, 20 Feb 2013 11:19:45 +0000 (12:19 +0100)]
Tweak MDB_INCOMPATIBLE description

11 years agoTweak prev commit: Restore if-test as an assert
Hallvard Furuseth [Wed, 20 Feb 2013 08:08:41 +0000 (09:08 +0100)]
Tweak prev commit: Restore if-test as an assert

11 years agoITS#7515 Fix mdb_txn_commit(nested txn).
Hallvard Furuseth [Tue, 19 Feb 2013 21:03:41 +0000 (22:03 +0100)]
ITS#7515 Fix mdb_txn_commit(nested txn).

Don't modify the parent txn until the current txn cannot fail.
Don't assume new dirty child pgnos > dirty parent pgnos.

Page alloc/touch: Fail if child+parent dirty pages would exceed
dirty_list's maxsize. Avoids an error situation in commit.

11 years agoITS#7512 Plug mdb_txn_abort(nested txn) page leaks.
Hallvard Furuseth [Tue, 19 Feb 2013 21:03:04 +0000 (22:03 +0100)]
ITS#7512 Plug mdb_txn_abort(nested txn) page leaks.

Also catch mdb_cursor_shadow() errors.

11 years agoCheck DB flags when refreshing a stale MDB DBI.
Hallvard Furuseth [Tue, 19 Feb 2013 21:02:37 +0000 (22:02 +0100)]
Check DB flags when refreshing a stale MDB DBI.

It's hairy to figure out when a DBI is valid. Catch destructive
user errors, and flags which another process changed under us.

11 years agomdb_cursor_prev,mdb_cursor_next: Fix return value.
Hallvard Furuseth [Tue, 19 Feb 2013 21:02:15 +0000 (22:02 +0100)]
mdb_cursor_prev,mdb_cursor_next: Fix return value.

Return mdb_node_read()'s return value if it fails, not 1.
(Can happen if mdb_page_get() fails and NDEBUG is #defined.)

11 years agoITS#7515 mdb_dbi_open(): Also open in parent txns.
Hallvard Furuseth [Tue, 19 Feb 2013 21:01:29 +0000 (22:01 +0100)]
ITS#7515 mdb_dbi_open(): Also open in parent txns.

This makes aborting nested and non-nested txns more
similar: The new DBI is available to the surrounding
context (parent txn and MDB_env respectively).

11 years agomdb_page_alloc(): Handle freeDB txnid range holes.
Hallvard Furuseth [Tue, 19 Feb 2013 20:17:33 +0000 (21:17 +0100)]
mdb_page_alloc(): Handle freeDB txnid range holes.

A txn writes no freeDB entry if previous txn dropped mainDB and a read
txn prevents freelist entry reuse. This surprised mdb_page_alloc (and
mdb_txn_commit too before 65c053a6e7f6973c1d09710aa1bd57b218206fcb).

11 years agoITS#7517 Document that dirty DBs may not be closed
Hallvard Furuseth [Tue, 19 Feb 2013 20:15:26 +0000 (21:15 +0100)]
ITS#7517 Document that dirty DBs may not be closed

11 years agoITS#7485 Document key/data size limits in lmdb.h.
Hallvard Furuseth [Tue, 19 Feb 2013 20:14:23 +0000 (21:14 +0100)]
ITS#7485 Document key/data size limits in lmdb.h.

mdb.c already describes them. The user doc should too.

11 years agoRevert "ITS#7515 update parent's mt_next_pgno on child commit"
Hallvard Furuseth [Sun, 17 Feb 2013 07:42:14 +0000 (08:42 +0100)]
Revert "ITS#7515 update parent's mt_next_pgno on child commit"

This reverts commit fd4861bf00fb0b86a9f3b80d16cbe363a8eac227.
It duplicated earlier code.

11 years agoITS#7515 update parent's mt_next_pgno on child commit
Howard Chu [Sun, 17 Feb 2013 00:49:53 +0000 (00:49 +0000)]
ITS#7515 update parent's mt_next_pgno on child commit

11 years agoDon't limit retries when coalescing freelist
Howard Chu [Sun, 17 Feb 2013 00:48:43 +0000 (00:48 +0000)]
Don't limit retries when coalescing freelist

Try to use whatever's available.

11 years agoITS#7515 Fix MDB parent/child txn interaction.
Hallvard Furuseth [Sat, 16 Feb 2013 18:11:20 +0000 (19:11 +0100)]
ITS#7515 Fix MDB parent/child txn interaction.

mdb_txn_commit(child): Copy more state. Copy all of mt_dbs:
Include mainDB, and even freeDB since mdb_drop() can update
it. Don't skip DBs with unchanged root, this could break
when the new was newly opened and the old unused junk.

mdb_page_get(): Search parents' dirty lists.

11 years agoITS#7377 Catch MDB failure updating root pointers.
Hallvard Furuseth [Sat, 16 Feb 2013 18:08:54 +0000 (19:08 +0100)]
ITS#7377 Catch MDB failure updating root pointers.

"cannot fail" was wrong, it fails at least when exceeding mapsize.

11 years agoITS#7517 Don't save dropped dirty MDB databases.
Hallvard Furuseth [Sat, 16 Feb 2013 18:08:37 +0000 (19:08 +0100)]
ITS#7517 Don't save dropped dirty MDB databases.

mdb_txn_commit's attempt to save the DB could corrupt another DB if
another thread had called mdb_dbi_open and reused the closed DBI.