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 1559945 - adjustment of csn_generator can fail so next generated csn can be equal to the most recent one received
Summary: adjustment of csn_generator can fail so next generated csn can be equal to th...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: thierry bordaz
QA Contact: RHDS QE
Marc Muehlfeld
URL:
Whiteboard:
Depends On:
Blocks: 1563079
TreeView+ depends on / blocked
 
Reported: 2018-03-23 15:19 UTC by mreynolds
Modified: 2020-09-13 22:09 UTC (History)
6 users (show)

Fixed In Version: 389-ds-base-1.3.8.2-1.el7
Doc Type: Bug Fix
Doc Text:
Directory Server correctly generates the CSN In a Directory Server replication topology, updates are managed by using Change Sequence Numbers (CSN) based on time stamps. New CSNs must be higher than the highest CSN present in the replica update vector (RUV). In case the server generates a new CSN in the same second as the most recent CSN, the sequence number is increased to ensure that it is higher. However, if the most recent CSN and the new CSN were identical, the sequence number was not increased. In this situation, the new CSN was, except the replica ID, identical to the most recent one. As a consequence, a new update in the directory appeared in certain situations older than the most recent update. With this update, Directory Server increases the CSN if the sequence number is lower or equal to the most recent one. As a result, new updates are no longer considered older than the most recent data.
Clone Of:
: 1563079 (view as bug list)
Environment:
Last Closed: 2018-10-30 10:13:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 2678 0 None closed adjustment of csn_generator can fail so next generated csn can be equal to the most recent one received 2020-09-21 22:03:03 UTC
Red Hat Product Errata RHSA-2018:3127 0 None None None 2018-10-30 10:14:08 UTC

Description mreynolds 2018-03-23 15:19:05 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/389-ds-base/issue/49619

#### Issue Description
On consumer side csn_generator ajustment occurs  (let CSN = highest known csn)

* when a replication session starts
* when a csn is generated locally and than csn is <= CSN

During adjustment, in the case

* there is no remote/local offset (time change)
* the current_time on the consumer is identical to CSN

Then next locally generated csn will only differ with **seqnum**

The **seqnum** of the csn_generator is increased only if CSN.seqnum is larger
than the csn_generator one.
In case of egality, it remains unchanged.

The consequence is that the next locally generated csn will be identical to CSN (except for the RID). So even after csn_generator adjustment, csn_generator may create csn that are not larger than the CSN

                                          



#### Package Version and Platform
All versions


#### Steps to reproduce

1. see FREEIPA-921

This is a timing issue, so it is not systematic. Now on the test systems it happens one time out of two.

#### Actual results
The generated csn can be lower than the highest known csn and urp can order operations in the opposite way.

#### Expected results
generated csn should strictly be larger than the  most recent one received

Comment 2 thierry bordaz 2018-03-23 15:21:13 UTC
Fix pushed upstream

Comment 4 thierry bordaz 2018-05-14 09:02:29 UTC
Impact of the bug

This bug can have a large range of impacts as constantly increasing CSN is a key requirement of replication.

Impact are most likely silent, replication resolve the conflict of CSN but in an invalid order. At the end of the day an attribute of an entry can have a different value that it should have.

The probability of hitting that bug is quite low (fast replication and replicated update triggering an other update). 

In IDM, Topology plugin was victim with a noticeable impact because this plugin triggers internal update and invalid result had a noticeable impact.
When topology plugin was merging two unidirectional segments into a bidirectionnal segment the invalid result of the segment status can lead to the deletion of one of the replication agreement.

Comment 11 errata-xmlrpc 2018-10-30 10:13:34 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.

https://access.redhat.com/errata/RHSA-2018:3127


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