Bug 56472 - syslog: mdb_id2entry_put: mdb_put failed: MDB_MAP_FULL
syslog: mdb_id2entry_put: mdb_put failed: MDB_MAP_FULL
Status: NEW
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-22 18:59 CEST by Arvid Requate
Modified: 2023-08-28 08:32 CEST (History)
9 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?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.086
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023081821000192
Bug group (optional): Large environments
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2023-08-22 18:59:26 CEST
Bug 56471 from Ticket#2023081821000192 shows a case where the mdb check

/usr/lib/nagios/plugins/check_univention_slapd_mdb_maxsize

didn't show any problems, but LDAP modify operations like group membership changes aborted with
===
ldap_modify: Other (e.g., implementation specific) error (80)
        additional info: entry update failed
===

and syslog showed:
===
Aug 22 10:54:32 backup03.domain.net slapd[12789]: mdb_id2entry_put: mdb_put failed: MDB_MAP_FULL: Environment mapsize limit reached(-30792) "cn=SOMERDN,cn=groups,ou=SOMEOU,$ldap_base"
===

We should add a check e.g. to system diagnostics to discover this situation.
Comment 1 Arvid Requate univentionstaff 2023-08-22 19:00:35 CEST
Additionally syslog had lines like these, maybe unrelated:
===
Aug 22 10:53:49 backup03.domain.net slapd[12789]: conn=82351 op=362: memberof_value_modify DN="uid=SOMEUSER,cn=lehrer,cn=users,ou=SOMEOU,$ldap_base" add memberOf="cn=SOMEGROUP1,cn=klassen,cn=schueler,cn=groups,ou=SOMEOU2,$ldap_base" failed err=32
Aug 22 10:53:49 backup03.domain.net slapd[12789]: conn=82351 op=362: memberof_value_modify DN="uid=SOMEUSER2,cn=lehrer,cn=users,ou=SOMEOU,$ldap_base" add memberOf="cn=SOMEGROUP1,cn=klassen,cn=schueler,cn=groups,ou=SOMEOU2,$ldap_base" failed err=20
Aug 22 10:53:53 backup03.domain.net slapd[12789]: conn=82351 op=388: memberof_value_modify DN="uid=SOMEUSER3,cn=schueler,cn=users,ou=SOMEOU,$ldap_base" delete memberOf="cn=SOMEGROUP2,cn=klassen,cn=schueler,cn=groups,ou=SOMEOU3,$ldap_base" failed err=16
===
Comment 2 Arvid Requate univentionstaff 2023-08-22 19:18:02 CEST
Affected system types:
* Backup Directory Node (not Primary)

Affected groups and sizes:
* cn=Windows Hosts (over 18000 memberUids)
* cn=computers (about 1000 memberUids)
* Some other group


The systems where set to
ldap/database/mdb/maxsize: 34359738368  ## == 32GiB

The data.mdb had 34359693312 bytes.

root@backup03: mdb_stat -ef /var/lib/univention-ldap/ldap.MDB_MAP_FULL
Environment Info
  Map address: (nil)
  Map size: 34359738368
  Page size: 4096
  Max pages: 8388608
  Number of pages used: 8388597
  Last transaction ID: 21958081
  Max readers: 126
  Number of readers used: 0
Freelist Status
  Tree depth: 3
  Branch pages: 16
  Leaf pages: 2922
  Overflow pages: 19096
  Entries: 25500
  Free pages: 7330224
Status of Main DB
  Tree depth: 2
  Branch pages: 1
  Leaf pages: 4
  Overflow pages: 0
  Entries: 128
Comment 3 Arvid Requate univentionstaff 2023-08-22 20:17:22 CEST
This is how we fixed it:

=========
root@backup03:~/univention-support # cat replace-copy-ldap-mdb.sh
#!/bin/bash

REPLY="no"
while [ "$REPLY" != YES ]; do
        read -p "REALLY RUN THIS?"
done

set -v
/etc/init.d/univention-directory-listener stop
/etc/init.d/slapd stop
mkdir /var/lib/univention-ldap/ldap2
time mdb_copy -c /var/lib/univention-ldap/ldap /var/lib/univention-ldap/ldap2

cp /var/lib/univention-ldap/ldap/DB_CONFIG /var/lib/univention-ldap/ldap2
mv /var/lib/univention-ldap/ldap /var/lib/univention-ldap/ldap.MDB_MAP_FULL
mv /var/lib/univention-ldap/ldap2 /var/lib/univention-ldap/ldap
chown -R openldap.openldap /var/lib/univention-ldap/ldap
/etc/init.d/slapd start
/etc/init.d/univention-directory-listener start
=========

After that the data.mdb had 4GB.