Add index and container for RFC 2307 IP services

IPA doesn't officially support RFC 2307 IP services. However SSSD has a
nsswitch plugin to provide service lookups. The subtree search for
(&(ipserviceport=$PORT)(ipserviceprotocol=$SRV)(objectclass=ipservice)) in
cn=accounts,$SUFFIX has caused performance issues on large
installations.

This patch introduced a dedicated container
cn=ipservices,cn=accounts,$SUFFIX for IP services for future use or 3rd
party extensions. SSSD will be change its search base in an upcoming
release, too.

A new ipServicePort index is added to optimize searches for an IP
service by port. There is no index on ipServiceProtocol because the index
would have poor selectivity. An ipService entry has either 'tcp' or 'udp'
as protocol.

Fixes: https://pagure.io/freeipa/issue/7797
See: https://pagure.io/freeipa/issue/7786
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes 2018-12-07 13:08:49 +01:00
parent c09927d16a
commit 39eaf2fab5
4 changed files with 29 additions and 0 deletions

View File

@ -34,6 +34,12 @@ objectClass: top
objectClass: nsContainer objectClass: nsContainer
cn: hostgroups cn: hostgroups
dn: cn=ipservices,cn=accounts,$SUFFIX
changetype: add
objectClass: top
objectClass: nsContainer
cn: ipservices
dn: cn=alt,$SUFFIX dn: cn=alt,$SUFFIX
changetype: add changetype: add
objectClass: nsContainer objectClass: nsContainer

View File

@ -333,3 +333,13 @@ objectClass: nsindex
nssystemindex: false nssystemindex: false
nsindextype: eq nsindextype: eq
nsindextype: sub nsindextype: sub
# NOTE: There is no index on ipServiceProtocol because the index would have
# poor selectivity. An ipService entry has either 'tcp' or 'udp' as protocol.
dn: cn=ipServicePort,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
cn: ipServicePort
objectClass: top
objectClass: nsIndex
nsSystemIndex: false
nsIndexType: eq

View File

@ -308,3 +308,10 @@ default: objectclass: nsindex
default: nssystemindex: false default: nssystemindex: false
default: nsindextype: eq default: nsindextype: eq
default: nsindextype: sub default: nsindextype: sub
dn: cn=ipServicePort,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
default: cn: ipServicePort
default: objectClass: top
default: objectClass: nsIndex
default: nsSystemIndex: false
default: nsIndexType: eq

View File

@ -0,0 +1,6 @@
# container for RFC 2307 IP services
dn: cn=ipservices,cn=accounts,$SUFFIX
default: objectClass: top
default: objectClass: nsContainer
default: cn: ipservices