Bug 1685059

Summary: After running cl-dump dbdir/cldb/*ldif.done are not deleted
Product: Red Hat Enterprise Linux 7 Reporter: German Parente <gparente>
Component: 389-ds-baseAssignee: Simon Pichugin <spichugi>
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact: Marc Muehlfeld <mmuehlfe>
Priority: high    
Version: 7.7CC: lkrispen, mreynolds, msauton, nkinder, pasik, sgouvern, spichugi, tbordaz, vashirov
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: 389-ds-base- Doc Type: Bug Fix
Doc Text:
.The `cl-dump.pl` and `cl-dump` utilities now remove temporary files after exporting the change log Previously, the `cl-dump.pl` and `cl-dump` utilities in Directory Server created temporary LDIF files in the `/var/lib/dirsrv/slapd-<instance_name>/changelogdb/` directory. After the change log was exported, the utilities renamed the temporary files to `*.done`. As a consequence, if the temporary files were large, this could result in low free disk space. With this update, by default, `cl-dump.pl` and `cl-dump` now delete the temporary files at the end of the export. Additionally, the `-l` option has been added to both utilities to manually preserve the temporary files. As a result, `cl-dump.pl` and `cl-dump` free the disk space after exporting the change log or user can optionally enforce the old behavior by using the `-l` option.
Story Points: ---
Clone Of:
: 1801700 (view as bug list) Environment:
Last Closed: 2020-03-31 19:46: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:
Bug Depends On:    
Bug Blocks: 1801700    

Description German Parente 2019-03-04 09:39:40 UTC
Description of problem:

cl-dump utility generates *.ldif files in the changelog directory. At the end, they are renamed to *ldif.done but they are never deleted.

And in some cases, these files can be very large which is provoking an issue at a customer.

Version-Release number of selected component (if applicable):

How reproducible: very simple by running cl-dump.pl

Comment 2 mreynolds 2019-03-15 16:36:56 UTC
Not sure I fully understand what the problem is.   Does the customer want the script to remove existing changelog LDIF files after creating a new one?  So this is a RFE not a bug, correct?

Comment 4 Simon Pichugin 2019-08-29 14:03:01 UTC
Upstream issue: 

Comment 5 Simon Pichugin 2019-09-03 16:38:09 UTC
So by default now, we remove ldif.done files after running cl-dump.
And if we specify an option '-l', it will allow us to preserve the files.
Man pages were updated too.

Comment 7 sgouvern 2019-11-07 13:51:14 UTC
Verified with 389-ds-base- - automated test ds/dirsrvtests/tests/suites/replication/changelog_test.py::test_cldump_files_removed

[root@cypher upstream]# py.test -v ds/dirsrvtests/tests/suites/replication/changelog_test.py
======================================================= test session starts =======================================================
platform linux -- Python 3.6.3, pytest-5.2.2, py-1.8.0, pluggy-0.13.0 -- /opt/rh/rh-python36/root/usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.6.3', 'Platform': 'Linux-3.10.0-1108.el7.x86_64-x86_64-with-redhat-7.8-Maipo', 'Packages': {'pytest': '5.2.2', 'py': '1.8.0', 'pluggy': '0.13.0'}, 'Plugins': {'metadata': '1.8.0', 'html': '2.0.0'}}
nss: 3.44.0-4.el7
nspr: 4.21.0-1.el7
openldap: 2.4.44-21.el7_6
cyrus-sasl: 2.1.26-23.el7
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, inifile: pytest.ini
plugins: metadata-1.8.0, html-2.0.0
collected 9 items                                                                                                                 

ds/dirsrvtests/tests/suites/replication/changelog_test.py::test_cldump_files_removed PASSED                                 [ 11%]
ds/dirsrvtests/tests/suites/replication/changelog_test.py::test_dsconf_dump_changelog_files_removed PASSED                  [ 22%]

Man pages verified sanity only with 389-ds-base- checkout :

21 .B cl\-dump
22 [\fI\-h host\fR] [\fI\-p port\fR] [\fI\-D bind\(hydn\fR] \-w bind\(hypassword | \-P bind\(hycert
23        [\fI\-r replica\(hyroots\fR] [\fI\-o output\(hyfile\fR] [\fI\-c\fR] [\fI\-l\fR] [\fI\-v\fR]
25 .PP

50 .B \-l
51 Preserve generated ldif.done files from changelogdir
52 .TP

72 .B \-v
73 Print the version of this script.

Comment 12 errata-xmlrpc 2020-03-31 19:46: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, and where to find the updated
files, follow the link below.

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