Bug 567282
Summary: | server can not abandon searchRequest of "simple paged results" | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Dmitry Kolesov <kolesov_dv> | ||||||
Component: | Directory Server | Assignee: | Noriko Hosoi <nhosoi> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 1.2.1 | CC: | amsharma, jgalipea, nhosoi, rmeggins | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | i686 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2015-12-07 16:43:42 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 639035, 656390 | ||||||||
Attachments: |
|
Description
Dmitry Kolesov
2010-02-22 15:01:45 UTC
Created attachment 457550 [details]
git patch file (master)
Description: Simple Paged Results search keeps the connection
per paging, but not an operation. When an abandon request is
issued, the operation referred by the request has already finished.
This patch introduces pagedresults_cleanup function to check
whether the connection is for the simple paged results or not, and
if it is, the simple paged results is cleaned up. If it is not,
pagedresults_cleanup does nothing. The function is called from
do_abandon as well as from connection_cleanup.
Files:
ldap/servers/slapd/abandon.c
ldap/servers/slapd/connection.c
ldap/servers/slapd/opshared.c
ldap/servers/slapd/pagedresults.c
ldap/servers/slapd/proto-slap.h
Created attachment 457566 [details]
test script
Steps to verify:
1) set up DS with some entries to search
2) run the attached script (ldapsearch.pl):
This sample command line sends out simple paged results request for 3 entries per page, then issues abandon request after 2 pages returned.
$ perl ldapsearch.pl -h <host> -p <port> -D <binddn> -w <passwd> -b <binddn> -pg 3 -abandon 2 "(objectclass=*)" dn
dn: dc=example,dc=com
dn: ou=Groups,dc=example,dc=com
dn: ou=People,dc=example,dc=com
next page size (3): # return
dn: ou=Special Users,dc=example,dc=com
dn: cn=HR Managers,ou=Groups,dc=example,dc=com
dn: cn=QA Managers,ou=Groups,dc=example,dc=com
next page size (3): # return
Calling abandon (2 vs. 2)
abandon returned: LDAP_SUCCESS <== abandon is issued and the new search begins.
dn: dc=example,dc=com
dn: ou=Groups,dc=example,dc=com
dn: ou=People,dc=example,dc=com
next page size (3):
Abandon request is logged in the access log:
[..] conn=3 op=2 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName"
[..] conn=3 op=2 RESULT err=0 tag=101 nentries=3 etime=0 notes=U,P
[..] conn=3 op=3 ABANDON targetop=Simple Paged Results
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[..] conn=3 op=4 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName"
Reviewed by Nathan (Thanks!!!). Pushed to master. $ git merge 567282 Updating 9fa6ff7..33245d1 Fast-forward ldap/servers/slapd/abandon.c | 7 ++++++- ldap/servers/slapd/connection.c | 11 +---------- ldap/servers/slapd/opshared.c | 2 +- ldap/servers/slapd/pagedresults.c | 24 ++++++++++++++++++++++++ ldap/servers/slapd/proto-slap.h | 1 + 5 files changed, 33 insertions(+), 12 deletions(-) $ git push Counting objects: 19, done. Delta compression using up to 4 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (10/10), 1.51 KiB, done. Total 10 (delta 8), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 9fa6ff7..33245d1 master -> master Hi Noriko, I am executing the attached script as: perl ldapsearch.pl -h localhost -p 1389 -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com" -pg 3 -abandon 2 "(objectclass=*)" dn It stops at : [root@rhel61 export]# perl ldapsearch.pl -h localhost -p 1389 -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com" -pg 3 -abandon 2 "(objectclass=*)" dn dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): I tried giving some different different inputs, but every time it gives me : dn: ou=Groups,dc=example,dc=com next page size (3): return dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com dn: cn=HR Managers,ou=Groups,dc=example,dc=com dn: cn=QA Managers,ou=Groups,dc=example,dc=com dn: cn=PD Managers,ou=Groups,dc=example,dc=com dn: ou=Accounting,dc=example,dc=com dn: ou=Product Development,dc=example,dc=com dn: ou=Product Testing,dc=example,dc=com dn: ou=Human Resources,dc=example,dc=com dn: ou=Payroll,dc=example,dc=com dn: uid=TVradmin0,ou=Accounting,dc=example,dc=com dn: uid=VLeBaron1,ou=Payroll,dc=example,dc=com dn: uid=JOshinski2,ou=Payroll,dc=example,dc=com dn: uid=DSubissat3,ou=Accounting,dc=example,dc=com dn: uid=LLe4,ou=Payroll,dc=example,dc=com dn: uid=BMcTurner5,ou=Product Development,dc=example,dc=com dn: uid=WVastine6,ou=Product Testing,dc=example,dc=com dn: uid=YLucas7,ou=Accounting,dc=example,dc=com dn: uid=VQuesnel8,ou=Product Testing,dc=example,dc=com dn: uid=aami,ou=People,dc=example,dc=com What should I do to get the expected result as you mentioned in comment#3? Do I need to modify the script? Please guide? (In reply to comment #5) > Hi Noriko, > > I am executing the attached script as: > perl ldapsearch.pl -h localhost -p 1389 -D "cn=Directory Manager" -w Secret123 > -b "dc=example,dc=com" -pg 3 -abandon 2 "(objectclass=*)" dn > > It stops at : > [root@rhel61 export]# perl ldapsearch.pl -h localhost -p 1389 -D "cn=Directory > Manager" -w Secret123 -b "dc=example,dc=com" -pg 3 -abandon 2 "(objectclass=*)" > dn > > dn: dc=example,dc=com > > dn: cn=Directory Administrators,dc=example,dc=com > > dn: ou=Groups,dc=example,dc=com > next page size (3): Did you hit return there? Something is not right... The script ldapsearch.pl is calling abandon: $mesg = $ldap->abandon($result); But do_abandon is not called on the server. The comment #3 shows ABANDON is logged in the access log, but not now on the upstream build. I'm reopening this bug... $ perl /tmp/ldapsearch.pl -h localhost -p 389 -D 'cn=directory manager' -w pw -b "dc=example,dc=com" -pg 3 -abandon 2 "(objectclass=*)" dn dn: dc=example,dc=com dn: ou=Accounting,dc=example,dc=com dn: ou=Product Development,dc=example,dc=com next page size (3): dn: ou=Product Testing,dc=example,dc=com dn: ou=Human Resources,dc=example,dc=com dn: ou=Payroll,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS <== but not actually called. dn: uid=TVradmin0,ou=Accounting,dc=example,dc=com dn: uid=VLeBaron1,ou=Payroll,dc=example,dc=com dn: uid=JOshinski2,ou=Payroll,dc=example,dc=com next page size (3): dn: uid=DSubissat3,ou=Accounting,dc=example,dc=com dn: uid=LLe4,ou=Payroll,dc=example,dc=com dn: uid=BMcTurner5,ou=Product Development,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS <== but not actually called. dn: uid=WVastine6,ou=Product Testing,dc=example,dc=com dn: uid=YLucas7,ou=Accounting,dc=example,dc=com [...] It looks my test env had a problem. Rich nicely confirmed "ABANDON" is working. Thus I'm putting the status back to MODIFIED to be reviewed. On 07/08/2011 01:05 PM, Rich Megginson wrote: Yes. Abandon is working for me: [08/Jul/2011:14:02:08 -0600] conn=1 op=4511 SRCH base="dc=localhost,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName" [08/Jul/2011:14:02:08 -0600] conn=1 op=4511 RESULT err=0 tag=101 nentries=3 etime=0 notes=U,P [08/Jul/2011:14:02:08 -0600] conn=1 op=4512 ABANDON targetop=Simple Paged Results Thanks Noriko, dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com next page size (3): dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com next page size (3): 10 Calling abandon (2 vs. 2) abandon returned: LDAP_SUCCESS dn: dc=example,dc=com dn: cn=Directory Administrators,dc=example,dc=com dn: ou=Groups,dc=example,dc=com dn: ou=People,dc=example,dc=com dn: ou=Special Users,dc=example,dc=com dn: cn=Accounting Managers,ou=Groups,dc=example,dc=com dn: cn=HR Managers,ou=Groups,dc=example,dc=com dn: cn=QA Managers,ou=Groups,dc=example,dc=com dn: cn=PD Managers,ou=Groups,dc=example,dc=com dn: ou=Accounting,dc=example,dc=com next page size (10): 100 dn: ou=Product Development,dc=example,dc=com dn: ou=Product Testing,dc=example,dc=com dn: ou=Human Resources,dc=example,dc=com dn: ou=Payroll,dc=example,dc=com dn: uid=TVradmin0,ou=Accounting,dc=example,dc=com dn: uid=VLeBaron1,ou=Payroll,dc=example,dc=com dn: uid=JOshinski2,ou=Payroll,dc=example,dc=com dn: uid=DSubissat3,ou=Accounting,dc=example,dc=com dn: uid=LLe4,ou=Payroll,dc=example,dc=com dn: uid=BMcTurner5,ou=Product Development,dc=example,dc=com dn: uid=WVastine6,ou=Product Testing,dc=example,dc=com dn: uid=YLucas7,ou=Accounting,dc=example,dc=com dn: uid=VQuesnel8,ou=Product Testing,dc=example,dc=com dn: uid=aami,ou=People,dc=example,dc=com dn: cn=Users,dc=example,dc=com dn: cn=groups,dc=example,dc=com dn: cn=UPG Template,dc=example,dc=com dn: uid=ttest,cn=Users,dc=example,dc=com dn: cn=ttest,cn=groups,dc=example,dc=com [root@rhel61 export]# tail -f /var/log/dirsrv/slapd-rhel61/access[13/Jul/2011:15:21:00 +051800] conn=35 op=100 RESULT err=0 tag=101 nentries=3 etime=0 notes=U,P [13/Jul/2011:15:21:00 +051800] conn=35 op=101 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName" [13/Jul/2011:15:21:00 +051800] conn=35 op=101 RESULT err=0 tag=101 nentries=3 etime=0 notes=U,P [13/Jul/2011:15:21:01 +051800] conn=35 op=103 ABANDON targetop=Simple Paged Results [13/Jul/2011:15:21:01 +051800] conn=35 op=104 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName" [13/Jul/2011:15:21:01 +051800] conn=35 op=104 RESULT err=0 tag=101 nentries=10 etime=0 notes=U,P [13/Jul/2011:15:21:03 +051800] conn=35 op=105 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)" attrs="distinguishedName" [13/Jul/2011:15:21:03 +051800] conn=35 op=105 RESULT err=0 tag=101 nentries=19 etime=0 notes=U,P [13/Jul/2011:15:21:03 +051800] conn=35 op=106 UNBIND [13/Jul/2011:15:21:03 +051800] conn=35 op=106 fd=64 closed - U1 Hence VERIFIED. |