[Date Prev][Date Next]
Re: (ITS#8264) LMDB mdb_del in a cursor causes data loss in certain situations
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#8264) LMDB mdb_del in a cursor causes data loss in certain situations
- From: firstname.lastname@example.org
- Date: Tue, 06 Oct 2015 04:44:49 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
> Full_Name: Michael Alyn Miller
> Version: LMDB 0.9.14, Git head
> OS: Windows 8.1 x64, NixOS 14.12 x64
> URL: ftp://ftp.openldap.org/incoming/michael-alyn-miller-151005.c
> Submission from: (NULL) (126.96.36.199)
> I have a helper library that sits on top of LMDB and testing some of the
> abstractions in that library has exposed a bug in LMDB related to deleting items
> while inside of a cursor. I have reduced the repro down to a test case that
> operates directly against LMDB.
> The test in question adds three groups of keys to the database (each with a
> different prefix) and then deletes the third group of keys. The deletion is
> done by scanning all of the keys with that prefix using a cursor.
> mdb_cursor_del works correctly and deletes only the targeted keys, whereas
> mdb_del causes nine extra keys (not in that group/prefix) to be deleted.
> I have tested this code against LMDB 0.9.14 and Git head 8b46dcc. Please let me
> know if you need any additional information. Thank you for your time!
Unable to reproduce.
violino:~/OD/mdb/libraries/liblmdb> gcc -g -c michael-alyn-miller-151005.c
violino:~/OD/mdb/libraries/liblmdb> gcc -o mic michael-alyn-miller-151005.o
Num items after deletion using mdb_cursor_del: 44 (correct)
Num items after deletion using mdb_del: 44 (correct)
violino:~/OD/mdb/libraries/liblmdb> git log
Author: Howard Chu <email@example.com>
Date: Sun Oct 4 01:56:25 2015 +0100
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.
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/