Issue 8375 - paged results control results in full db search?
Summary: paged results control results in full db search?
Status: UNCONFIRMED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.44
Hardware: All All
: --- normal
Target Milestone: 2.7.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 07:57 UTC by Geert Hendrickx
Modified: 2022-01-31 17:59 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 Geert Hendrickx 2016-02-22 07:57:49 UTC
Full_Name: Geert Hendrickx
Version: 2.4.44
OS: Linux
URL: http://www.openldap.org/lists/openldap-technical/201602/msg00094.html
Submission from: (NULL) (2a02:1810:4d03:d00:18e9:3ca5:a68f:c7f4)


We found an odd issue when using LDAP Admin (www.ldapadmin.org), which by
defaults uses the paged results control (RFC 2696) to limit search results.

This client initially issues an objectclass=* search with one-level scope
to list the first-level objects/trees on the LDAP DIT, which you can then
browse/expand by clicking on them.

On a large db, we noticed this initial search hits the timelimit, even
though the equivalent command line search is instant.  I found the
difference is in using the paged result control:

ldapsearch -s one -E \!pr=100 objectclass=\* objectclass        => slow
ldapsearch -s one             objectclass=\* objectclass        => fast

The slapd stats+trace logging of each is in attachment.  Notice the large
number of objects being skipped with "scope not okay" in the first, where
this does not happen in the second.  This slows down the search, and on a
very large db, makes it exceed the configured 60 seconds timelimit.

A third variant, setting the sizelimit explicitly, avoids the issue:

ldapsearch -s one -E \!pr=100 -z 100 objectclass=\* objectclass => fast

Is this expected behaviour?
Comment 1 OpenLDAP project 2017-04-14 19:52:55 UTC
Seems buggy
Comment 2 Quanah Gibson-Mount 2017-04-14 19:52:55 UTC
changed notes
moved from Incoming to Software Bugs
Comment 3 Quanah Gibson-Mount 2021-06-10 16:59:43 UTC
Hi Geert,

Can you confirm if this issue still occurs with OpenLDAP 2.5? A number of changes in this regard have been made to back-mdb.
Comment 4 Geert Hendrickx 2021-09-01 07:14:57 UTC
Hi

I can reproduce exactly the same behaviour with OpenLDAP 2.5.7, on a freshly slapadd'ed mdb.
Comment 5 Quanah Gibson-Mount 2021-09-01 15:09:51 UTC
(In reply to geert.hendrickx@telenetgroup.be from comment #4)
> Hi
> 
> I can reproduce exactly the same behaviour with OpenLDAP 2.5.7, on a freshly
> slapadd'ed mdb.

Target milestone for the fix is 2.7.0, so that's expected. ;)
Comment 6 Quanah Gibson-Mount 2021-09-01 15:10:24 UTC
I'll put needs review on it though so we can discuss. ;)
Comment 7 Geert Hendrickx 2021-09-01 15:17:39 UTC
I can reproduce it on any sufficiently large db, both tree-structured or flat, given the right search scope.