Bug 2062679

Summary: RFE - Enable the replication changelog trimming by default.
Product: Red Hat Directory Server Reporter: Têko Mihinto <tmihinto>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: medium Docs Contact: Evgenia Martynyuk <emartyny>
Priority: high    
Version: 11.4CC: afarley, bsmejkal, emartyny, gfialova, jachapma, ldap-maint, mreynolds, pcech, skurup, tbordaz
Target Milestone: DS11.6Keywords: TestCaseProvided, Triaged
Target Release: dirsrv-11.6   
Hardware: x86_64   
OS: Linux   
Whiteboard: sync-to-jira
Fixed In Version: redhat-ds-11-8070020220729181859-54d36466 Doc Type: Enhancement
Doc Text:
.Replication changelog trimming is now enabled by default in Directory Server Previously, Directory Server was not configured to automatically trim the replication `changelog` file by default. Consequently, the `changelog` file could become very large. With this update, Directory Server is configured by default to trim changelog entries that are older than seven days, preventing excessive growth of the `changelog` file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-14 08:53:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Têko Mihinto 2022-03-10 10:50:30 UTC
Description of problem:
By default, the trimming of the replication changelog is disabled.
It's not rare to see customers with hundreds of GB for the replication changelog.
Trimming such large changelogs can be:
* time-consuming ( if the trimming is done by small chunks )
* CPU-intensive ( if the settings are too aggressive ).

Version-Release number of selected component (if applicable):
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
$
$ rpm -qa | grep 389-ds-base-1
389-ds-base-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.x86_64
$

How reproducible:
Always.

Steps to Reproduce:
1. Enable replication
2. Make replication updates
3. Check the replication changelog size

Actual results:
Continuous growth of the replication changelog.

Expected results:
Limited growth by trimming the oldest changes.

Additional info:
RHEL IdM sets the nsslapd-changelogmaxage to 2 days for its embedded LDAP server:
$ grep -i ^nsslapd-changelogmax /etc/dirsrv/slapd-<DOMAIN>/dse.ldif
nsslapd-changelogmaxage: 2d
$

Comment 1 mreynolds 2022-03-10 12:55:38 UTC
Upstream ticket:

https://github.com/389ds/389-ds-base/issues/4866

Comment 6 Jamie Chapman 2022-10-20 12:40:22 UTC
Verified with:
Red Hat Enterprise Linux release 8.7 (Ootpa)
389-ds-base-1.4.3.31-6.module+el8dsrv+16980+c4b9cd33

Acceptance test output:
[root@localhost upstream]# py.test -v ds/dirsrvtests/tests/suites/replication/acceptance_test.py::test_default_cl_trimming_enabled                                           
re-exec with libfaketime dependencies                                                                                                                                        
============================================================================ test session starts ============================================================================
platform linux -- Python 3.6.8, pytest-7.0.1, pluggy-1.0.0 -- /usr/bin/python3.6                                                                                             
cachedir: .pytest_cache                                                                                                                                                      
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-425.3.1.el8.x86_64-x86_64-with-redhat-8.7-Ootpa', 'Packages': {'pytest': '7.0.1', 'py': '1.11.0', 'pluggy': '1.0.0'},
 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1', 'libfaketime': '0.1.2', 'flaky': '3.7.0'}}                                                                               
389-ds-base: 1.4.3.31-6.module+el8dsrv+16980+c4b9cd33                                                                                                                        
nss: 3.79.0-10.el8_6                                                                                                                                                         
nspr: 4.34.0-3.el8_6                                                                                                                                                         
openldap: 2.4.46-18.el8                                                                                                                                                      
cyrus-sasl: 2.1.27-6.el8_5                                                                                                                                                   
FIPS: disabled                                                                                                                                                               
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, configfile: pytest.ini                                                                                               
plugins: metadata-1.11.0, html-3.1.1, libfaketime-0.1.2, flaky-3.7.0                                                                                                         
collected 1 item                                                                                                                                                             
                                                                                                                                                                             
ds/dirsrvtests/tests/suites/replication/acceptance_test.py::test_default_cl_trimming_enabled PASSED                                                                   [100%]

Comment 7 bsmejkal 2022-10-24 10:10:40 UTC
As per comment #c6, marking as VERIFIED.

Comment 11 Evgenia Martynyuk 2022-11-07 14:29:17 UTC
Updated DocText

.Replication changelog trimming is now enabled by default in the Directory Server

Previously, replication `changelog` trimming was disabled by default in the Directory Server. Consequently, the `changelog` file became increasingly large and trimming large files can be time consuming and result in high CPU usage, if an overly aggressive trimming setting is applied.

With this update, the Directory Server, by default, trims the `changelog` entries that are older than seven days, preventing excessive growth of the `changelog` file.

Comment 12 Evgenia Martynyuk 2022-11-08 17:00:07 UTC
More short version of the RN text is added:

.Replication changelog trimming is now enabled by default in Directory Server

Previously, Directory Server was not configured to automatically trim the replication `changelog` file by default. Consequently, the `changelog` file could become very large. With this update, Directory Server is configured by default to trim changelog entries that are older than seven days, preventing excessive growth of the `changelog` file.

Comment 14 errata-xmlrpc 2022-11-14 08:53:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (redhat-ds:11 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7929