Bug 2130276 - The scheduled time of the changelog compaction is not taken into account.
Summary: The scheduled time of the changelog compaction is not taken into account.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.5
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: DS11.7
: dirsrv-11.7
Assignee: mreynolds
QA Contact: LDAP QA Team
Evgenia Martynyuk
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-27 16:42 UTC by Têko Mihinto
Modified: 2023-05-24 12:39 UTC (History)
9 users (show)

Fixed In Version: redhat-ds-11-8080020221130182235.022a399e
Doc Type: Bug Fix
Doc Text:
.The scheduled time of the changelog compaction now works correctly Previously, when you configured a custom scheduled time for the changelog compaction, the server did not apply the new setting, and the changelog compaction could start during peak times. With this release, the server now correctly applies the custom time of the changelog compaction.
Clone Of:
Environment:
Last Closed: 2023-05-23 09:27:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker IDMDS-2589 0 None None None 2022-10-20 12:24:18 UTC
Red Hat Issue Tracker IDMDS-2772 0 None None None 2023-02-09 10:00:29 UTC
Red Hat Product Errata RHBA-2023:3267 0 None None None 2023-05-23 09:28:34 UTC

Description Têko Mihinto 2022-09-27 16:42:07 UTC
Description of problem:
A customer has configured the replication changelog DB compaction to happen at a specific time ( nsslapd-changelogcompactdb-time: 02:00 ).
Nonetheless the compaction is happening much later after the scheduled time.

Version-Release number of selected component (if applicable):
$ head -1 errors
	389-Directory/1.4.3.29 B2022.087.1507
$

389-ds-base-libs-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64
389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64

How reproducible:
At a customer site.

Steps to Reproduce:
1. Configure the compaction time:
# dsconf -D "cn=Directory Manager" ldaps://<HOST>:<PORT> replication set-changelog --compact-time 02:00

2. The compaction interval is set to 2 days ( nsslapd-changelogcompactdb-interval: 172800 )

3. Check the compaction times in the errors log:

$ grep "compacting replication changelogs" errors* | tail -4
errors.20220923-000111:[23/Sep/2022:03:07:19.412873289 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs...
errors.20220923-000111:[23/Sep/2022:03:07:19.967053493 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs finished.
errors.20220925-000136:[25/Sep/2022:08:18:24.326787653 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs...
errors.20220925-000136:[25/Sep/2022:08:18:24.531876733 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs finished.
$

Actual results:
Compaction is happening at unplanned times.

Expected results:
Compaction should happen at scheduled times.
Some customers cannot afford to have the DB compaction starting during peak times.

Additional info:

Comment 1 Têko Mihinto 2022-10-07 18:30:19 UTC
The compaction starts at the expected time when the nsslapd-changelogcompactdb-time is unset ( thus using the default value of 23:59 ):

grep -i compa /var/log/dirsrv/slapd-localhost/errors*
/var/log/dirsrv/slapd-localhost/errors.20221002-000222:[02/Oct/2022:23:59:27.161439332 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs...
/var/log/dirsrv/slapd-localhost/errors.20221002-000222:[02/Oct/2022:23:59:32.867428009 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs finished.
/var/log/dirsrv/slapd-localhost/errors.20221004-000154:[04/Oct/2022:23:59:01.988719414 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs...
/var/log/dirsrv/slapd-localhost/errors.20221004-000154:[04/Oct/2022:23:59:22.602587530 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs finished.
/var/log/dirsrv/slapd-localhost/errors.20221006-000152:[06/Oct/2022:23:59:25.458998883 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs...
/var/log/dirsrv/slapd-localhost/errors.20221006-000152:[06/Oct/2022:23:59:25.870496531 +0200] - NOTICE - NSMMReplicationPlugin - changelog program - cl5CompactDBs - compacting replication changelogs finished.

Comment 5 mreynolds 2022-11-15 19:56:55 UTC
I think I know what is going on.  The issue is the compaction interval.  It's set to 2 days, but the way it works is that it's two days (48 hours) from the time the server "starts".  It's just a timer.  So if the server was restarted at 8:00, then the trim/compact thread is not going to wake up until 8:00 two days later.  It wakes up, and sees that it's past the 2:00 TOD setting and thinks it must compact.  The reason why 11:59 works is because it's at the very end of the day.  When the time is early in the day then this can break.

Continuing investigation...

Comment 6 mreynolds 2022-11-17 20:28:58 UTC
Fixed upstream:

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

Comment 22 Evgenia Martynyuk 2023-05-10 09:56:54 UTC
Hi Mark!

Could you please review the DocText field with the RN text draft. 

Thanks, 
Evgenia

Comment 23 mreynolds 2023-05-10 12:08:55 UTC
(In reply to Evgenia Martynyuk from comment #22)
> Hi Mark!
> 
> Could you please review the DocText field with the RN text draft. 
> 
> Thanks, 
> Evgenia

Looks good

Comment 24 Evgenia Martynyuk 2023-05-17 07:16:19 UTC
RN passed a peer review, RN text is release pending

Comment 26 errata-xmlrpc 2023-05-23 09:27:55 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-2023:3267


Note You need to log in before you can comment on or make changes to this bug.