]>
git.ipfire.org Git - thirdparty/openldap.git/log
Howard Chu [Sat, 9 Sep 2017 14:08:03 +0000 (15:08 +0100)]
ITS#8728 fix MDB_VL32 freeing overflow page
Howard Chu [Wed, 6 Sep 2017 20:15:48 +0000 (21:15 +0100)]
ITS#8722 fix FIRST_DUP/LAST_DUP cursor bounds check
Howard Chu [Fri, 1 Sep 2017 12:16:37 +0000 (13:16 +0100)]
Doc tweaks
Note about DB names being C strings
Howard Chu [Thu, 31 Aug 2017 14:44:31 +0000 (15:44 +0100)]
Add mdb_cursor_is_db()
Return 1 if the cursor is pointing to a named DB record
Howard Chu [Thu, 31 Aug 2017 14:11:54 +0000 (15:11 +0100)]
mdb_dbi_open tweak
Always save the terminating NUL of the incoming DB name
Stop using the old mdb_open/mdb_close function names
.. should consider renaming mdb_stat/mdb_drop to mdb_dbi_... too.
Howard Chu [Sat, 12 Aug 2017 10:16:45 +0000 (11:16 +0100)]
ITS#8704 Fix PREVMETA, rename to PREVSNAPSHOT
and enforce exclusive access to environment. Also fix txn_begin/pick_meta
to use correct meta page, and reset the flag after successful commit.
Hallvard Furuseth [Sun, 6 Aug 2017 14:18:06 +0000 (16:18 +0200)]
Unref ovpages when deleting them
Hallvard Furuseth [Sun, 6 Aug 2017 14:15:51 +0000 (16:15 +0200)]
Drop always-false MDB_WRITEMAP test when IS_DIRTY_NW()
Howard Chu [Mon, 31 Jul 2017 18:15:21 +0000 (19:15 +0100)]
ITS#8704 Add MDB_PREVMETA support to tools
Howard Chu [Mon, 31 Jul 2017 18:07:01 +0000 (19:07 +0100)]
ITS#8704 Add PREVMETA to envflags()
moneromooo-monero [Sun, 30 Jul 2017 23:04:28 +0000 (00:04 +0100)]
ITS#8704 add MDB_PREVMETA flag to mdb_env_open
used to open the previous meta page, in case the latest one
is corrupted
From https://github.com/LMDB/lmdb/pull/12
Hallvard Furuseth [Sat, 29 Jul 2017 14:31:06 +0000 (16:31 +0200)]
Expose MDB_ENCRYPT flag
Hallvard Furuseth [Sat, 29 Jul 2017 12:54:55 +0000 (14:54 +0200)]
Rename mdb_env_getflags->envflags, clarify options
The old name resembled existing function mdb_env_get_flags().
Hallvard Furuseth [Sat, 29 Jul 2017 05:59:39 +0000 (07:59 +0200)]
mdb_page_get() can ignore the toplevel spill list
...when we search dirty list before instead of after spill list.
Hallvard Furuseth [Sat, 29 Jul 2017 05:59:01 +0000 (07:59 +0200)]
Drop mdb_page_get() arg 'level', it's always NULL
Hallvard Furuseth [Sat, 29 Jul 2017 05:56:46 +0000 (07:56 +0200)]
Doc fixes
Hallvard Furuseth [Thu, 27 Jul 2017 06:22:34 +0000 (08:22 +0200)]
Less hungry mdb_pages_xkeep()
Skip pages that are dirty only in an ancestor txn
Hallvard Furuseth [Thu, 27 Jul 2017 06:19:03 +0000 (08:19 +0200)]
Keep MC_OVPG() == NULL when not MDB_REMAPPING()
Needed since
418ea8b94e14567ba2be9f9772f38f563a0d7e9c introduced
option MDB_REMAP_CHUNKS.
Howard Chu [Wed, 26 Jul 2017 20:37:40 +0000 (21:37 +0100)]
ITS#8699 more for cursor_del ITS#8622
Set C_DEL flag on reinit'd subcursor
Howard Chu [Wed, 26 Jul 2017 19:52:31 +0000 (20:52 +0100)]
Fix
418ea8b94e SEGV on spilled ovpg
Don't spill an ovpg that is referenced in a cursor
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Drop P_DIRTY, and MDB_WRITEMAP dirty/spill lists
mt_workid = mt_txnid when WRITEMAP, so dirty pages == "spilled"
pages and mdb_page_flush() does nothing.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
mp_txnid = page state, avoids searching dirty_list
In nested txns, check mp_txnid to see which txn dirtied the page.
This change will also let us remove the P_DIRTY flag, and keep
some flags in (dirty page).mp_txnid if we should need it.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Demo - move P_DIRTY to P_ADM_FLAGS, page_dirty()
...to have something substantial to test P_ADM_FLAGS with,
at least until we drop the P_DIRTY flag.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Divide page flags in P_ADM_FLAGS and the rest
P_ADM_FLAGS flags are tied to the page, even through page_loose-alloc.
OTOH mdb_page_split() should only duplicate the relevant flags.
This is just the code for the feature, P_ADM_FLAGS is 0 for now.
We'll need it for P_HIDESPILL later.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Drop unnecessary searches in the spill lists
Check with IS_MUTABLE() if an MDB_page is spilled, instead of
searching spill lists. When unspilling, skip parent spill lists.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Skip unnecessary mdb_page_get()s when spilling
Do not bring in pages merely to see if they should be skipped.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Protect freelist at end of mdb_freelist_save()
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Use mdb_page_loose() more
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Verify final loose_count in mdb_txn_commit()
Mismatch may indicate that pages leaked or got used twice
in the same snapshot.
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
mdb_page_touch: Always set MDB_TXN_ERROR on error
Hallvard Furuseth [Tue, 25 Jul 2017 19:27:36 +0000 (21:27 +0200)]
Fix mdb_enctest()
Accept a partial ovpage. I.e. decryption of the beginning
should not depend on the data at the end.
Make the key and IV less regular. (Divisor 67 has period>64.)
Hallvard Furuseth [Tue, 25 Jul 2017 19:07:14 +0000 (21:07 +0200)]
Move misplaced OVERFLOW_NOTYET code
...so it would set pgno,txnid in the MDB_dovpage, not the actual ovpage
Hallvard Furuseth [Tue, 25 Jul 2017 19:03:48 +0000 (21:03 +0200)]
Fix broken mdb_page_get(ovpage) optimization
Hallvard Furuseth [Tue, 25 Jul 2017 18:17:21 +0000 (20:17 +0200)]
Fix last commit - sizeof(pgno_t) and C90 compat
Howard Chu [Tue, 25 Jul 2017 14:34:03 +0000 (15:34 +0100)]
Scaled back on overflow page work
Still keeping page header at top of overflow page for now
Howard Chu [Mon, 17 Jul 2017 12:02:00 +0000 (13:02 +0100)]
checkpoint - moving overflow page headers
Moving headers outside of overflow page.
Howard Chu [Sun, 2 Jul 2017 16:13:48 +0000 (17:13 +0100)]
Data format change: add txnid to page header
Hallvard Furuseth [Sat, 1 Jul 2017 06:04:59 +0000 (08:04 +0200)]
Trivial encryption when $LMDB_FLAGS = "e"
Hallvard Furuseth [Sat, 1 Jul 2017 11:15:37 +0000 (13:15 +0200)]
Get flags from $LMDB_FLAGS when MDB_TEST
Now we don't need to tweak the code of callers to test encryption.
Howard Chu [Fri, 30 Jun 2017 15:30:29 +0000 (16:30 +0100)]
Save/restore enc IV in page 0
Howard Chu [Fri, 30 Jun 2017 14:42:38 +0000 (15:42 +0100)]
Plug some information leaks
Zero out decrypted pages before freeing them.
Do proper init on reused loose pages.
Howard Chu [Thu, 29 Jun 2017 17:22:34 +0000 (18:22 +0100)]
Add test code for remap / encryption
Howard Chu [Thu, 29 Jun 2017 15:18:52 +0000 (16:18 +0100)]
Page-level encryption support
Currently encrypts all but the meta pages
Still needs to store/retrieve the initialization vector
Hallvard Furuseth [Sat, 1 Jul 2017 16:57:09 +0000 (18:57 +0200)]
Rename mdb_env_close0() -> mdb_env_close_active()
Hopefully we'll remember now what goes in which function.
Howard Chu [Thu, 29 Jun 2017 15:07:17 +0000 (16:07 +0100)]
Optimization for mdb_rpage_get()
The caller already knows if it's using an overflow page, so
pass the number of expected pages in instead of having to
map the page first and check the count there.
Howard Chu [Thu, 1 Jun 2017 16:48:04 +0000 (17:48 +0100)]
RPAGE_CACHE is now dynamically selectable
Behavior is controlled by MDB_REMAP_CHUNKS envflag
Remapping is always enabled in MDB_VL32
Howard Chu [Sat, 27 May 2017 14:37:14 +0000 (15:37 +0100)]
Add new MDB_RPAGE_CACHE def
Separate 32/64 dependency from rpage buffer mechanism
Howard Chu [Wed, 12 Apr 2017 22:55:29 +0000 (23:55 +0100)]
Fix Android recognition
The official macro is __ANDROID__; ANDROID may or may not be defined.
Howard Chu [Tue, 7 Jun 2016 22:38:47 +0000 (23:38 +0100)]
MDB_VL32
Use the same size dirty list for both 64 and 32 bit.
Howard Chu [Thu, 23 Mar 2017 20:37:24 +0000 (20:37 +0000)]
ITS#8622 fix xcursor after cursor_del
Re-fix
6b1df0e4c7fadd21d1233d7157229b2d89ccaa04 from ITS#8406
Hallvard Furuseth [Sun, 12 Mar 2017 19:08:53 +0000 (20:08 +0100)]
ITS#8582 Fill in MDB_LOCK_FORMAT
Attempt to stop liblmdb variants compiled with conflicting options
from using the lockfile at the same time and thus breaking it.
Hallvard Furuseth [Sun, 12 Mar 2017 15:59:23 +0000 (16:59 +0100)]
Clear any struct padding in idbuf
Hallvard Furuseth [Sun, 12 Mar 2017 15:58:51 +0000 (16:58 +0100)]
Simplify mdb_hash_val() -> mdb_hash()
Simpler usage since it's only called once, rename to match new usage,
and drop 3 loop pessimizations which were optimizations 20 years ago.
Hallvard Furuseth [Sun, 12 Mar 2017 15:55:14 +0000 (16:55 +0100)]
Store lock ID instead of pathname in lockfile
This limits the namespace which the user can meddle with for
POSIX semaphores and Windows mutexes. Their names change a
bit, they no longer have fixed lengths.
Hallvard Furuseth [Sat, 4 Mar 2017 12:03:15 +0000 (13:03 +0100)]
ITS#8582 MDB_LOCK_VERSION = 2 due to format change
Howard Chu [Mon, 6 Feb 2017 15:09:26 +0000 (15:09 +0000)]
ITS#8582 keep mutex at end of struct
since it's variable size on Linux/glibc
Howard Chu [Tue, 31 Jan 2017 10:41:52 +0000 (10:41 +0000)]
Workaround VL32 cursor refcounting miscount
Don't try to deref cursor page if txn's pagelist is empty
Howard Chu [Sat, 14 Jan 2017 19:22:34 +0000 (19:22 +0000)]
Further fix
f8ce8a82717ddefdc912fa47c07f1bdee2a3336b
Fully revert the change to GET_MULTIPLE
Howard Chu [Thu, 12 Jan 2017 13:35:31 +0000 (13:35 +0000)]
Howard Chu [Wed, 11 Jan 2017 14:39:08 +0000 (14:39 +0000)]
Happy New Year
Howard Chu [Wed, 11 Jan 2017 11:19:18 +0000 (11:19 +0000)]
More C_EOF tweaks
Howard Chu [Wed, 11 Jan 2017 11:18:57 +0000 (11:18 +0000)]
ITS#8557 fix prev commit
Howard Chu [Wed, 11 Jan 2017 10:33:28 +0000 (10:33 +0000)]
Tweak cursor_next C_EOF check
Allow C_EOF flag to be stale
Howard Chu [Wed, 11 Jan 2017 09:51:43 +0000 (09:51 +0000)]
ITS#8557 fix mdb_cursor_last
Optimize mdb_page_search_root(PS_LAST) when cursor is already near
last position, ignoring C_EOF flag for now.
Howard Chu [Fri, 6 Jan 2017 19:48:58 +0000 (19:48 +0000)]
ITS#8558 fix mdb_load with escaped plaintext
Howard Chu [Wed, 28 Dec 2016 18:30:19 +0000 (18:30 +0000)]
ITS#8554 kFreeBSD is like BSD
Doesn't have POSIX robust mutexes - GNU userland on BSD kernel
Hallvard Furuseth [Wed, 21 Dec 2016 20:40:14 +0000 (21:40 +0100)]
More MDB_node doc
Hallvard Furuseth [Wed, 21 Dec 2016 15:33:47 +0000 (16:33 +0100)]
Doxygen fixes. Use DISTRIBUTE_GROUP_DOC.
- DISTRIBUTE_GROUP_DOC makes doxygen give several fields the
same doc: mn_hi + mn_lo in MDB_node.
- With mdb_mutex_t + mdb_mutexref_t, instead split them up.
- Don't hide a doxygen #name inside double quotes.
Hallvard Furuseth [Thu, 15 Dec 2016 21:12:45 +0000 (22:12 +0100)]
Mention MDB_PREV_MULTIPLE along with MDB_NEXT_MULTIPLE
Hallvard Furuseth [Thu, 20 Oct 2016 07:51:22 +0000 (09:51 +0200)]
ITS#8504 Fix prev commit: mc_error, #ifdef SIGPIPE
Never clear mc_error, we could lose a failure in the other thread.
Lorenz Bauer [Thu, 20 Oct 2016 07:51:22 +0000 (09:51 +0200)]
ITS#8504 mdb_env_copyfd2(): Don't abort on SIGPIPE
Return EPIPE instead.
Hallvard Furuseth [Sat, 10 Dec 2016 21:00:31 +0000 (22:00 +0100)]
ITS#7377 Catch mdb_cursor_sibling() error
Hallvard Furuseth [Sat, 10 Dec 2016 20:42:39 +0000 (21:42 +0100)]
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.
Hallvard Furuseth [Sat, 10 Dec 2016 20:11:12 +0000 (21:11 +0100)]
ITS#8355 cleanup
Drop ~C_EOF, pointless after
8c215aa970215a58ee0df458813c0405ad27a6e9
Hallvard Furuseth [Sat, 10 Dec 2016 16:17:28 +0000 (17:17 +0100)]
MDB_VL32 cleanup: MDB_env.mm_mapsize type
Hallvard Furuseth [Sat, 10 Dec 2016 08:16:17 +0000 (09:16 +0100)]
ITS#8542 mdb_dbi_open(): Protect mainDB cursors
Hallvard Furuseth [Thu, 8 Dec 2016 23:03:36 +0000 (00:03 +0100)]
Cleanup: Add flag DB_DUPDATA, drop DB_DIRTY hack
Hallvard Furuseth [Wed, 7 Dec 2016 18:06:11 +0000 (19:06 +0100)]
MDB_CP_COMPACT comments
Hallvard Furuseth [Wed, 7 Dec 2016 18:04:19 +0000 (19:04 +0100)]
doxygen cleanup
Hallvard Furuseth [Wed, 7 Dec 2016 17:55:21 +0000 (18:55 +0100)]
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.
Hallvard Furuseth [Fri, 2 Dec 2016 05:20:29 +0000 (06:20 +0100)]
MDB_VL32 mdb_page_get(): Set MDB_TXN_ERROR on failure.
Hallvard Furuseth [Fri, 2 Dec 2016 04:22:11 +0000 (05:22 +0100)]
Fix mdb_env_open() with MDB_VL32
Init me_rpmutex independently of MDB_NOLOCK.
Plug leaks on mdb_env_open() failure.
Tweak mdb_env_close0() to handle the rearranged mdb_env_open().
Hallvard Furuseth [Thu, 1 Dec 2016 20:17:42 +0000 (21:17 +0100)]
Factor out refreshing sub-page pointers
Howard Chu [Tue, 29 Nov 2016 19:19:45 +0000 (19:19 +0000)]
More for ITS#8406
xcursor fixup depends on init state
Howard Chu [Sat, 12 Nov 2016 23:11:20 +0000 (23:11 +0000)]
More for ITS#8406
Revert excess cursor fixup
Hallvard Furuseth [Tue, 27 Sep 2016 05:03:45 +0000 (07:03 +0200)]
Only set me_mfd if needed. Drop unused read access.
Hallvard Furuseth [Tue, 27 Sep 2016 05:03:42 +0000 (07:03 +0200)]
ITS#8505 Clarify fork() caveat, mdb_env_get_fd(), flock->fcntl.
Hallvard Furuseth [Tue, 27 Sep 2016 05:03:40 +0000 (07:03 +0200)]
ITS#8505 Protect parent from fork()-pthread_exit()
Hallvard Furuseth [Tue, 27 Sep 2016 05:03:38 +0000 (07:03 +0200)]
ITS#8505 Set FD_CLOEXEC for me_mfd,env_copy as well
Hallvard Furuseth [Tue, 27 Sep 2016 05:03:34 +0000 (07:03 +0200)]
Move opening files to mdb_fopen()
No change in functionality.
Hallvard Furuseth [Sat, 17 Sep 2016 19:31:04 +0000 (21:31 +0200)]
Factor filename handling out to mdb_fname_*()
No change in functionality, except needs less mallocing.
Hallvard Furuseth [Tue, 6 Sep 2016 16:12:01 +0000 (18:12 +0200)]
ITS#7992 Tighter utf8_to_utf16(), fix errcodes
The 0xFFFD check seems due to misleading MultiByteToWideChar() doc.
Bad UTF-8 gives 0xFFFD in the output string, not the return value.
Hallvard Furuseth [Tue, 6 Sep 2016 15:56:13 +0000 (17:56 +0200)]
Clean up strange fcntl result check
...and check !MDB_CLOEXEC in an 'if' rather than '#if'
to match its non-zero usage.
Hallvard Furuseth [Tue, 6 Sep 2016 15:48:31 +0000 (17:48 +0200)]
Drop spurious Errcode() call
Hallvard Furuseth [Tue, 6 Sep 2016 15:41:02 +0000 (17:41 +0200)]
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.
Hallvard Furuseth [Sat, 3 Sep 2016 07:41:30 +0000 (09:41 +0200)]
Silence warning for initializer "mdb_copy my = {0}"
1st struct member was not a scalar.
Howard Chu [Wed, 31 Aug 2016 23:41:35 +0000 (00:41 +0100)]
ITS#8489 reset cursor EOF flag in cursor_set
It usually gets done anyway, but one of the fastpath shortcuts
bypassed this step.
Hallvard Furuseth [Sun, 21 Aug 2016 21:22:18 +0000 (23:22 +0200)]
Clean up MDB_USE_ROBUST #defines
Make explicit and default nonzero equivalent. Parenthesize.
Hallvard Furuseth [Sun, 21 Aug 2016 21:20:22 +0000 (23:20 +0200)]
Fix mdb_page_list() message
Howard Chu [Fri, 19 Aug 2016 16:24:25 +0000 (17:24 +0100)]
ITS#8481 make shared lib suffix overridable