Issue 8336 - assert(NUMKEYS(mp) > 1) in mdb_page_search_root()
Summary: assert(NUMKEYS(mp) > 1) in mdb_page_search_root()
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-08 15:22 UTC by Hallvard Furuseth
Modified: 2016-02-11 00:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 2015-12-08 15:22:57 UTC
Full_Name: Hallvard B Furuseth
Version: LMDB 0.9.17
OS: Linux x86_64
URL: 
Submission from: (NULL) (129.240.203.186)
Submitted by: hallvard


$ mtest_rand -c0 -i10000 -p0x100 -r562822527.3 -w
// Options for replay: [-v] -c0 -i10000 -p0x100 -r562822527.3 -w
../mdb.c:5276: Assertion 'NUMKEYS(mp) > 1' failed in mdb_page_search_root()
Aborte%2(core dumped)

Broken by 4b01cb3 "ITS#8221 don't merge branch pages needlessly"
according to git bisect.
Comment 1 Howard Chu 2015-12-08 18:03:17 UTC
h.b.furuseth@usit.uio.no wrote:
> Full_Name: Hallvard B Furuseth
> Version: LMDB 0.9.17
> OS: Linux x86_64
> URL:
> Submission from: (NULL) (129.240.203.186)
> Submitted by: hallvard
>
>
> $ mtest_rand -c0 -i10000 -p0x100 -r562822527.3 -w
> // Options for replay: [-v] -c0 -i10000 -p0x100 -r562822527.3 -w
> ../mdb.c:5276: Assertion 'NUMKEYS(mp) > 1' failed in mdb_page_search_root()
> Aborte%2(core dumped)
>
> Broken by 4b01cb3 "ITS#8221 don't merge branch pages needlessly"
> according to git bisect.

The assert occurs during txn_commit while updating the freeDB. During 
rebalance, a branch page in the freeDB has been reduced to only 1 key. This 
page is operated on by another (recursive) rebalance. During page_touch, a new 
page is needed, which calls page_alloc, which needs to acquire a free page 
from the freeDB. The resulting search trips this assert because it walks down 
thru the branch page that is currently being rebalanced.

We could simply remove the assert; if we let things progress then eventually 
the rebalance will succeed and the branch page will be correct. We could also 
conditionalize the assert so that it ignores the freeDB. Or we can just ignore 
the problem entirely, because it only occurs on tiny 256 byte pages.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2015-12-08 18:41:44 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 3 Quanah Gibson-Mount 2016-01-19 08:09:52 UTC
changed notes
changed state Test to Release
Comment 4 OpenLDAP project 2016-02-11 00:51:29 UTC
fixed in mdb.master
fixed in mdb 0.9
fixed in RE24 (2.4.44)
Comment 5 Quanah Gibson-Mount 2016-02-11 00:51:29 UTC
changed notes
changed state Release to Closed