Bug 1658280
Summary: | [RFE] FreeIPA/Dogtag - Slow host deletion due to certificate pagination | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | JaredL <jaredl> |
Component: | pki-core | Assignee: | RHCS Maintainers <rhcs-maint> |
Status: | CLOSED WONTFIX | QA Contact: | Asha Akkiangady <aakkiang> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 8.3 | CC: | cheimes, gparente, jaredl, mharmsen, msauton, pcech, tmihinto |
Target Milestone: | rc | Keywords: | FutureFeature, Reopened, Triaged |
Target Release: | --- | Flags: | pm-rhel:
mirror+
|
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-10-31 07:26:53 UTC | Type: | Feature Request |
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: | 1851495 | ||
Bug Blocks: |
Description
JaredL
2018-12-11 16:46:37 UTC
It's more of a design flaw in IPA. IPA's implementation for cert revokation of host and service certs is inefficient. It should not need to build a full list of certificates. I have created https://pagure.io/freeipa/issue/7835 to track the issue. Hey Christian! Thanks for responding. That makes sense, as a workaround, do you know if there's any way for the pagination setting used for these searches to be configured? For context as well, I also posted to the freeipa-users list: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org/thread/ALXF4RPIKXWGNYBI2LJI7S67J3HQ4UAO/ Currently, a host-del operation in our production environments takes up to 5 minutes to complete/return. We frequently terminate hosts in the environment and spending 5 minutes per host is causing a lot of pain for our users. I think if I can configure the pagination limit used here to be 10,000 or higher, that'll significantly improve things on our end. Thanks, Jared try to set a "user-level" size limit for the entry doing the LDAP BIND of those operations, pkidbuser, for example: ldapsearch -LLLx -D "cn=directory manager" -W -b ou=people,o=ipaca uid=pkidbuser nssizelimit cat << EOF > /var/tmp/add.nssizelimit.to.uid.pkidbuser.ldif dn: uid=pkidbuser,ou=people,o=ipaca changetype: modify add: nsSizeLimit nsSizeLimit: 10000 EOF ldapmodify -xD "cn=directory manager" -W -f /var/tmp/add.nssizelimit.to.uid.pkidbuser.ldif I think no LDAP server restart is required: ldapsearch -LLLx -D "cn=directory manager" -W -b ou=people,o=ipaca uid=pkidbuser nssizelimit nor a CA restart ( if needed: systemctl start pki-tomcatd ) and try again... Hey Marc, Thanks for the idea! I gave it a try but sadly, after setting nsSizeLimit to 10,000 for the 'pkidbuser', it's still paging at 2,000 entries as seeing with the following in /var/log/pki/pki-tomcat/ca/debug: [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: SessionContextInterceptor: CertResource.searchCerts() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: SessionContextInterceptor: Not authenticated. [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: CertResource.searchCerts() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: mapping: default [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: loading /usr/share/pki/ca/conf/auth-method.properties [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: checking /var/lib/pki/pki-tomcat/ca/conf/auth-method.properties [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: required auth methods: [*] [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: AuthMethodInterceptor: anonymous access allowed [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: ACLInterceptor: CertResource.searchCerts() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: ACLInterceptor.filter: no authorization required [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: ACLInterceptor: No ACL mapping; authz not required. [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: SignedAuditLogger: event AUTHZ [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: MessageFormatInterceptor: CertResource.searchCerts() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: MessageFormatInterceptor: content-type: application/xml [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: MessageFormatInterceptor: accept: [] [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: MessageFormatInterceptor: request format: application/xml [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: MessageFormatInterceptor: response format: application/xml [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: CertService.searchCerts() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: CertService: filter: (certstatus=*) [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: CertificateRepository.findCertRecordsInList() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: In LdapBoundConnFactory::getConn() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: masterConn is connected: true [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: getConn: conn is connected true [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: getConn: mNumConns now 2 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: In DBVirtualList filter attrs sortKey pageSize filter: (certstatus=*) attrs: null pageSize 2147483647 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: returnConn: mNumConns now 3 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: searching for entry A [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 1 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: top: 9901 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: size: 9902 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: CertService: total: 9902 [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getPage(0) [25/Jan/2019:22:11:30][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: getEntries: exception java.lang.ClassCastException: netscape.ldap.LDAPException cannot be cast to netscape.ldap.LDAPEntry [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 2000 [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getPage(2000) [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: getEntries: exception java.lang.ClassCastException: netscape.ldap.LDAPException cannot be cast to netscape.ldap.LDAPEntry [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 2000 [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getPage(3999) [25/Jan/2019:22:11:31][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: getEntries: exception java.lang.ClassCastException: netscape.ldap.LDAPException cannot be cast to netscape.ldap.LDAPEntry [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 2000 [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getPage(5998) [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: getEntries: exception java.lang.ClassCastException: netscape.ldap.LDAPException cannot be cast to netscape.ldap.LDAPEntry [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 2000 [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getPage(7997) [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList.getEntries() [25/Jan/2019:22:11:32][ajp-bio-127.0.0.1-8009-exec-1]: DBVirtualList: entries: 1906 # ldapsearch -LLL -o ldif-wrap=no -D 'cn=Directory Manager' -W -s sub -b 'ou=people,o=ipaca' '(uid=pkidbuser)' nsSizeLimit Enter LDAP Password: dn: uid=pkidbuser,ou=people,o=ipaca nsSizeLimit: 10000 Just to make sure, I went ahead and restart FreeIPA with ipactl restart as well. That actually appears to have done the trick, now I'm seeing that it's only paging once getting all 9902 entries! [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: SessionContextInterceptor: CertResource.searchCerts() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: SessionContextInterceptor: Not authenticated. [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: AuthMethodInterceptor: CertResource.searchCerts() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: AuthMethodInterceptor: mapping: default [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: AuthMethodInterceptor: required auth methods: [*] [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: AuthMethodInterceptor: anonymous access allowed [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: ACLInterceptor: CertResource.searchCerts() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: ACLInterceptor.filter: no authorization required [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: ACLInterceptor: No ACL mapping; authz not required. [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: SignedAuditLogger: event AUTHZ [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: MessageFormatInterceptor: CertResource.searchCerts() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: MessageFormatInterceptor: content-type: application/xml [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: MessageFormatInterceptor: accept: [] [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: MessageFormatInterceptor: request format: application/xml [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: MessageFormatInterceptor: response format: application/xml [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: CertService.searchCerts() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: CertService: filter: (certstatus=*) [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: CertificateRepository.findCertRecordsInList() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: In LdapBoundConnFactory::getConn() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: masterConn is connected: true [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: getConn: conn is connected true [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: getConn: mNumConns now 2 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: In DBVirtualList filter attrs sortKey pageSize filter: (certstatus=*) attrs: null pageSize 2147483647 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: returnConn: mNumConns now 3 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList: searching for entry A [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList.getEntries() [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList: entries: 1 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList: top: 9901 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList: size: 9902 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: CertService: total: 9902 [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList.getPage(0) [25/Jan/2019:22:15:29][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList.getEntries() [25/Jan/2019:22:15:30][ajp-bio-127.0.0.1-8009-exec-3]: DBVirtualList: entries: 9902 Thanks! Ah! The CA probably needed to re-do the LDAP BIND as pkidbuser if that connection was kept opened and used. thanks for confirming/testing fast! I have committed a workaround to IPA that optimizes the search query for host names. There is more room for optimization, but they need additional changes to Dogtag, too. Fixed upstream master: https://pagure.io/freeipa/c/ae74d348c3da580264c56441c136af3fc6ae58df https://pagure.io/freeipa/c/6cd37542e6c563ddd8595d488712935a4d6b17bf Fixed upstream ipa-4-6: https://pagure.io/freeipa/c/1e842f0fea290cbf8935eea79ea16e17650b7328 https://pagure.io/freeipa/c/9a0783f5ac8a2c7426b4db3a818fa6583bab16e1 ipa-4-7: https://pagure.io/freeipa/c/a243bd56a65e47b03ee3ba772413b580aeb35ba9 https://pagure.io/freeipa/c/2ccd4da44b5d66298bf1d4938fa3dc6ce2dbfa84 As per grooming meeting 20200428, this bug can be fixed by having a upgrade to database framework After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. |