Bug 58047 - Better handling of LDAP MDB fragmentation
Summary: Better handling of LDAP MDB fragmentation
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: LDAP
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.2-1-errata
Assignee: Arvid Requate
QA Contact: Dirk Wiesenthal
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-06 12:48 CET by Finn David
Modified: 2025-10-01 12:58 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support: Yes
Flags outvoted (downgraded) after PO Review:
Ticket number: 2024100921000238
Bug group (optional):
Customer ID: 01427
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Finn David univentionstaff 2025-03-06 12:48:05 CET
This is the follow-up to a recent import problem from one of our customers. We noticed that one of the main contributing factors was a fragmented LDAP LMDB database.

In order to prevent this from happening again, our product should:
- Check and inform administrators about this
- Provide an easy way to fix this


Upstream explanation of the issue

When a write operation is performed with LMDB, the freelist is scanned for available space to reuse if possible.  The larger the size of the freelist, the longer amount of time it will take for the operation to complete successfully. 
When the database has gotten to a certain point of fragmentation (This differs based on any individual use case), it will be start taking a noticeable amount of time for those write operations to complete and the server processing the write operation does essentially come to a halt during this process.  Once the write operation completes, things go back to normal. 
The only solution is to dump and reload the database (slapcat/slapadd or mdb_copy -c). Eventually, you will get back into the same situation and have to do this again.
Comment 2 Dirk Wiesenthal univentionstaff 2025-04-30 06:41:47 CEST
univention-management-console-module-diagnostic.yaml
a385c9bfe388 | Bug #58047: Add check for LMDB fragmentation

univention-management-console-module-diagnostic (8.0.20)
a385c9bfe388 | Bug #58047: Add check for LMDB fragmentation

univention-base-files.yaml
74cd9d8b7a17 | Bug #58047: Minor typo in texts
a385c9bfe388 | Bug #58047: Add check for LMDB fragmentation

univention-base-files (11.0.11)
74cd9d8b7a17 | Bug #58047: Minor typo in texts

univention-base-files (11.0.10)
a385c9bfe388 | Bug #58047: Add check for LMDB fragmentation
Comment 3 Dirk Wiesenthal univentionstaff 2025-04-30 06:43:06 CEST
OK: CLI and defaults
OK: Finds fragmentation according to parameters
OK: Diagnostic module
OK: Help article
OK: Tests
OK: Works on memberserver, too