Jean-Charles ROGEZ wrote:
Hello,
This is a known limitation with regard to frequent updates of large entries, it causes
excessive fragmentation of the free page space. There are workarounds in OpenLDAP 2.5
back-mdb, but work is ongoing to improve free page management in LMDB 1.0.
I suggest you migrate your database to OpenLDAP 2.5, after configuring
"multival" on
the backend. See the slapd-mdb(5) manpage for details.
We use OpenLDAP 2.4.57 under RHEL8 with a configuration with 2 directories in MM and 2
replicas. We only write on one of the masters.
The size of the LMDB database grows following writes of members of large groups (2000
members) by a batch which runs every 10 minutes.
The base grows regularly and sometimes undergoes significant jumps until it reaches its
maximum size.
The lmdb_stat -ef command indicates that very few pages are used and everything else is
free pages. The used pages are stable.
And yet, it is no longer possible to write in the directory. Sometimes it's on the
master directory, sometimes on replicas where syncrepl fails.
2021-03-24T11: 52: 59.978157 + 01: 00 int-ohz-infra1 slapd debug local4 25076 -
mdb_id2entry_put: mdb_put failed: MDB_MAP_FULL: Environment mapsize limit
reached (-30792) "uid = us-00000301, ou = users, dc = bst, dc = ocn, dc = infra, dc
= ftgroup "
2021-03-24T11: 52: 59.978184 + 01: 00 int-ohz-infra1 slapd debug local4 25076 -
syncrepl_null_callback: error code 0x50
2021-03-24T11: 52: 59.978202 + 01: 00 int-ohz-infra1 slapd debug local4 25076 -
syncrepl_entry: rid = 001 be_modify failed (80)
2021-03-24T11: 52: 59.978780 + 01: 00 int-ohz-infra1 slapd debug local4 25076 -
do_syncrepl: rid = 001 rc 80 retrying
There is no transaction in progress:
mdb_stat -r /var/lib/ldap/data/
Reader Table Status
pid thread txnid
25076 7fa0e42c5480 -
25076 7fa0977fe700 -
25076 7fa097fff700 -
25076 7fa094cfa700 -
25076 7fa086ffe700 -
25076 7fa0857fb700 -
25076 7fa0867fd700 -
25076 7fa085ffc700 -
25076 7fa074ffc700 -
The batch executes a lot of transactions < 2s.
Restarting slapd does not resolve the problem.
If we compact the database with mdb_copy -c, it only makes a few MB and it works again.
The problem no longer appears without large groups.
Why are free pages not used? Wouldn't there be a problem with writing many
multi-valued attributes?
Thank you for your help !
Jean-Charles Rogez
twitter icon <
https://twitter.com/csnovidys>
linkedin icon <
https://www.linkedin.com/company/novidy's>
*Jean-Charles ROGEZ*
*Architecte Système* | INTEGRATION SYSTEMES | PLESSIS
Standard : +33180848010 <tel:+33180848010>
Ligne directe : <tel:r>
Mobile : <tel:>
Email : jean-charles.rogez(a)csnovidys.com
<mailto:jean-charles.rogez@csnovidys.com>
--
-- Howard Chu
CTO, Symas Corp.
http://www.symas.com
Director, Highland Sun
http://highlandsun.com/hyc/
Chief Architect, OpenLDAP
http://www.openldap.org/project/