Trimming the change log

When change logging is on, the LDAP server periodically trims the change log based on the limits set in the LDAP server configuration file.

If a change log entry exceeds the age limit set using the changeLogMaxAge configuration option, it is removed from the log.

If the number of change log entries exceeds the limit set using the changeLogMaxAge configuration option, the change log entries with the lowest changenumber values are removed. The number of entries that are removed depends on how GDBM is configured. When GDBM is file-based, entries are removed until the number of entries remaining is at the limit. When GDBM is Db2®-based, entries are removed until the number of entries remaining is about 95% of the limit. For example, if changeLogMaxAge is 1000 and the number of entries in the change log reaches 1001, the 51 lowest entries are deleted to reduce the number of entries to 950.

The change log is checked for trimming when the server is started (for a Db2-based change log only) and when change log entries are added. When Db2-based, the change log is also periodically trimmed, with a frequency determined by the server based on the change log limits and contents. The frequency cannot be directly modified. No trimming is performed when the GDBM backend is in read-only mode. Trimming is performed when the LDAP server is in maintenance mode (and GDBM is not read-only).