Bug 34877 - replace ldapsearch with "pagedResults" ldapsearch in the listener
replace ldapsearch with "pagedResults" ldapsearch in the listener
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 5.0
Other Linux
: P5 enhancement (vote)
: UCS 5.0-2-errata
Assigned To: Philipp Hahn
Peter Stoll
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-20 13:04 CEST by Felix Botner
Modified: 2023-02-01 17:24 CET (History)
12 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.429
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022102121000414
Bug group (optional): Roadmap discussion (moved)
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2014-05-20 13:04:32 CEST
Currently the listener's ldapsearch is limited to "ldap/sizelimit" (from the master) results (default 400000). The listener can't handle setups with more than 400000 ldap objects (i guess).

We need to: 

(1)
configure limits for "pagedResults" ldapsearch in slapd.conf (e.g. add "size.pr=5000 size.prtotal=unlimited" to limits in slapd.conf, max 5000 results per page, unlimited pagedResults search), see bug #34873 

(2)
replace normale ldapsearch in the listener with "pagedResults" ldapsearch
Comment 1 Felix Botner univentionstaff 2014-06-13 13:53:53 CEST
It is possible to define multiple limits in slapd.conf and to overwrite the default sizelimit for special dns/groups with e.g. "unlimited". So maybe it is enough to add the special limit "size.soft=unlimited size.hard=unlimited" for cn=admin and slave hosts.
Comment 2 Felix Botner univentionstaff 2014-06-13 15:19:37 CEST
(In reply to Felix Botner from comment #1)
> It is possible to define multiple limits in slapd.conf and to overwrite the
> default sizelimit for special dns/groups with e.g. "unlimited". So maybe it
> is enough to add the special limit "size.soft=unlimited size.hard=unlimited"
> for cn=admin and slave hosts.


sizelimit               4000
limits group/posixGroup/uniqueMember="cn=DC Backup Hosts,cn=groups,dc=fff,dc=ggg" size=unlimited time.soft=-1 time.hard=-1
limits dn="cn=admin,dc=fff,dc=ggg" size=unlimited time.soft=-1 time.hard=-1
limits users time.soft=-1 time.hard=-1

=> sizelimit 4000 for everybody except cn=admin and members of DC Backup Hosts
Comment 3 Philipp Hahn univentionstaff 2015-12-11 16:49:35 CET
*** Bug 40230 has been marked as a duplicate of this bug. ***
Comment 4 Florian Best univentionstaff 2017-06-28 14:52:26 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 5 Christina Scheinig univentionstaff 2022-10-25 13:01:19 CEST
25.10.22 11:33:17.367  LISTENER    ( WARN    ) : initializing module replication
File: /var/lib/univention-ldap/ldap/DB_CONFIG
slapd: Kein Prozess gefunden
File: /var/lib/univention-ldap/ldap/DB_CONFIG
Starting slapd (via systemctl): slapd.service.
25.10.22 11:33:33.991  LISTENER    ( ERROR   ) : could not get DNs when initializing replication: Size limit exceeded
Comment 6 Christina Scheinig univentionstaff 2022-10-25 13:13:37 CEST
root@dc0:~# univention-ldapsearch -s sub -b "$(ucr get ldap/base)" -z max -l max -A -E pr=100/noprompt '(objectClass=*)' 1.1 |tail
# requesting: 1.1 
# with pagedResults control: size=100
#

# search result
search: 4003
result: 4 Size limit exceeded

# numResponses: 404001
# numEntries: 400000
Comment 7 Philipp Hahn univentionstaff 2022-10-25 13:24:58 CEST
$ slapcat | grep -c ^dn:
Customer has 1.5 M entries, but UCRV "ldap/sizelimit=400k"

Using paged-results does not help to mitigate the limit.

This becomes a BIG problem when joining a new Backup into a large environment or doing a re-join: In that case the replication.py module is not initialized at all:

$ /usr/sbin/univention-directory-listener-dump|grep '^listenerModule: replication'

Maybe also add a UMC diagnostics module to warn if "number of LDAP entries" exceeds UCRV "ldap/sizelimit". (Sadly I know of now simple way to just count the number of entries except the above mentioned command.)
Comment 9 Christina Scheinig univentionstaff 2022-10-26 13:34:21 CEST
Funny thing is, that we have got 
25.10.22 11:33:33.991  LISTENER    ( ERROR   ) : could not get DNs when initializing replication: Size limit exceeded
during listener cache recreation but starting the listener the normal way it was fine:

26.10.22 09:11:13.232  LISTENER    ( WARN    ) : initializing module replication
File: /var/lib/univention-ldap/ldap/DB_CONFIG
slapd: no process found
File: /var/lib/univention-ldap/ldap/DB_CONFIG
Starting slapd (via systemctl): slapd.service.
26.10.22 12:13:03.992  LISTENER    ( WARN    ) : finished initializing module replication with rv=0


3       replication     /usr/lib/univention-directory-listener/system/replication.py
Comment 10 Oliver Friedrich univentionstaff 2022-11-02 10:39:28 CET
Workaround described here: https://help.univention.com/t/howto-fix-re-join-in-big-environments/20662
Comment 12 Peter Stoll univentionstaff 2023-01-20 15:33:32 CET
QA:
- Code review
- installed univention-ldap package
- diff-ed /etc/ldap/slapd.conf before and after
- tested size limit exceeded behaviour before and after.
Comment 13 Philipp Hahn univentionstaff 2023-01-20 17:48:05 CET
Package: univention-ldap
Version: 16.0.7-26A~5.0.0.202301201745
Branch: ucs_5.0-0
Scope: errata5.0-2

[5.0-2] 1087b64d44 Bug #34877: univention-ldap 16.0.7-26A~5.0.0.202301201745
 doc/errata/staging/univention-ldap.yaml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Comment 14 Peter Stoll univentionstaff 2023-01-23 11:27:16 CET
QA:
- Check YAML file for completeness and validity