Bug 50673 - Reduce slapd downtime during updates by triggering online reindexing of LMDB
Reduce slapd downtime during updates by triggering online reindexing of LMDB
Status: NEW
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.4
Other Linux
: P5 enhancement with 4 votes (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-27 20:08 CET by Arvid Requate
Modified: 2020-04-20 10:27 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Further conceptual development, Troubleshooting
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 2019-12-27 20:08:22 CET
The manpage of slapd-mdb has this interesting statement:

> changing  index  settings  dynamically  by LDAPModifying "cn=config"
> automatically causes rebuilding of the indices online in a background task.

This could be useful e.g. to reduce re-indexing delays during updates of large environments.
Comment 1 Arvid Requate univentionstaff 2019-12-30 13:32:45 CET
From a quick look into the code it looks like slapd-mdb re-indexes *everything* by iterating over all entries.

I think we need some resource/performance test of this feature to find out the conditions (size of database, number of cores) where this is a good option.


FYI: slapindex on the other hand offers the option to only index specific attributes, but our ldap_setup_index script currently doesn't make use of that.

I guess we also need to think about a way to ensure that this is not run multiple times during an update or join (see Bug 49821), e.g. in case an app package uses ldap_setup_index to configure another index. We could delay the re-inxeding by making ldap_setup_index just set an UCR variable which later triggers the actual re-indexing (with cron or dpkg triggers or whatever). But the indexing should not "hit" the admins unexpectedly and bog down the servers.