RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1181346 - nsslapd-changelogtrim-interval is not applied immediately
Summary: nsslapd-changelogtrim-interval is not applied immediately
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: wibrown@redhat.com
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-12 23:21 UTC by Viktor Ashirov
Modified: 2020-09-13 21:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-31 14:58:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ticket48007_test.py (5.39 KB, text/plain)
2016-05-31 13:47 UTC, Viktor Ashirov
no flags Details
verification lib389 test script (5.07 KB, text/plain)
2017-10-31 14:57 UTC, mreynolds
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 1338 0 None None None 2020-09-13 21:19:53 UTC

Description Viktor Ashirov 2015-01-12 23:21:06 UTC
Description of problem:
When nsslapd-changelogtrim-interval is changed, it doesn't take effect immediately. 

Version-Release number of selected component (if applicable):
389-ds-base-1.3.3.1-11.el7.x86_64


How reproducible:
always

Steps to Reproduce:
[1]  Setup DS using "dc=example,dc=com"
[2]  Create the changelog
[3]  Set the max entries, and changelog trim interval

dn: cn=changelog5,cn=config
changetype: modify
replace: nsslapd-changelogmaxentries
nsslapd-changelogmaxentries: 5
-
replace: nsslapd-changelogtrim-interval
nsslapd-changelogtrim-interval: 15


[4]  Enable replication for "dc=example,dc=com"
[5]  Turn on replication logging

dn: cn=config
changetype: modify
replace: nsslapd-errorlog-level
nsslapd-errorlog-level: 8192

[6]  Add 10 entries to "dc=example,dc=com"

[7]  Sleep for 15 seconds

[8]  Grep the error log for "changes from the changelog"

Actual results:
Next trim starts only after current trim is finished (notice the timestamps)
[13/Jan/2015:00:13:23 +0100] NSMMReplicationPlugin - changelog program - cl5GetOperationCount: found DB object 7f072400df50
[13/Jan/2015:00:18:16 +0100] - Trimmed 5 changes from the changelog


Expected results:
Trimming thread should be notified that config was updated.

Comment 2 Noriko Hosoi 2015-01-19 19:21:18 UTC
Thank you, Viktor!

This is not a release stopper for 7.1; setting the target to 7.2 per weekly mtg.

Comment 3 Noriko Hosoi 2015-01-28 00:31:46 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/48007

Comment 7 Noriko Hosoi 2016-05-10 01:15:55 UTC
Hi Viktor,

It seems Mark and Willam failed to duplicate the problem.
(See https://fedorahosted.org/389/ticket/48007)

Is it okay to close this bug for now?
Please feel free to reopen it when you run into it.
Probably, you could let us access your test env once you see the bug again?

Thanks!

Comment 8 Viktor Ashirov 2016-05-10 11:51:22 UTC
With the steps given in description I'm still able to reproduce it.

Comment 9 Noriko Hosoi 2016-05-25 20:52:08 UTC
William and Viktor, I think you'd better talk on the same page... :)

https://fedorahosted.org/389/ticket/48007#comment:10
> I can reproduce "getting the change log to trim" but in my tests, it appears that the moment I set the new trim time, it's taking effect immediately, and correctly. I think this is actually not an issue, and the difference in log times is a co-incidence.
>
> I would like to close this as "not a bug" if that's okay with you, but I am happy to discuss it more if you like. Do you still want the test case that proves it's not an issue?

Comment 10 Viktor Ashirov 2016-05-31 13:46:53 UTC
I tried William's test on the affected version, it fails with

        # Now parse the trim_event lines. We should only see 5 seconds between them.
        # This test basically should generate 3 trim events.
        # The first one from the server setup, one from the first add, a third from the last.
>       assert(len(trim_events) >= 3)
E       assert 0 >= 3
E        +  where 0 = len([])


On 389-ds-base-1.3.5.4-1.el7.x86_64:
        # Now parse the trim_event lines. We should only see 5 seconds between them.
        # This test basically should generate 3 trim events.
        # The first one from the server setup, one from the first add, a third from the last.
>       assert(len(trim_events) >= 3)
E       assert 2 >= 3
E        +  where 2 = len(['[31/May/2016:09:31:06.492981568 -0400] Trimmed 17 changes from the changelog\n', '[31/May/2016:09:31:13.797244226 -0400] Trimmed 9 changes from the changelog\n'])

Actually in the logs:
grep trim /var/log/dirsrv/slapd-master_1/errors -i
[31/May/2016:09:31:06.492981568 -0400] Trimmed 17 changes from the changelog
[31/May/2016:09:31:13.797244226 -0400] Trimmed 9 changes from the changelog
[31/May/2016:09:36:13.947764120 -0400] Trimmed 11 changes from the changelog

I don't know why it took 5 minutes to trim last changes.

Comment 11 Viktor Ashirov 2016-05-31 13:47:49 UTC
Created attachment 1163243 [details]
ticket48007_test.py

Comment 17 mreynolds 2017-10-23 19:45:40 UTC
I can confirm that 1.3.7 works correctly.  Perhaps the test case is flawed, but I stepped through the code and everything is working after changing the trim interval.  The trimming thread wakes up right after the config change as you would expect, and it does trim entries (if those entries have exceeded the changelog maxage).

Comment 18 mreynolds 2017-10-31 14:57:28 UTC
Created attachment 1345973 [details]
verification lib389 test script

This is a revised test case that shows the server is working as expected


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