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 1851973 - Duplicate entryUSN numbers for different LDAP entries in the same backend
Summary: Duplicate entryUSN numbers for different LDAP entries in the same backend
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.0
Assignee: Simon Pichugin
QA Contact: RHDS QE
URL:
Whiteboard:
Depends On:
Blocks: 1904348
TreeView+ depends on / blocked
 
Reported: 2020-06-29 14:31 UTC by mreynolds
Modified: 2021-05-18 15:45 UTC (History)
6 users (show)

Fixed In Version: 389-ds-devel-1.4-8040020201105165416.866effaa
Doc Type: Bug Fix
Doc Text:
Cause: Using both USN and MemberOf plugins and adding 'member' attribute with a user DN value to a group Consequence: The user and the group have the same entryUSN values Fix: Cleanup USN plugin's code so it increments and assigns entryUSN counter in the same preop operation. Result: The user and the group have different entryUSN values
Clone Of:
: 1904348 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:45:18 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 2359 0 None closed Duplicate entryUSN numbers for different LDAP entries in the same backend 2020-12-03 14:54:06 UTC

Description mreynolds 2020-06-29 14:31:29 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/389-ds-base/issue/49300

#### Issue Description
According to the description of entryUSN plugin and attribute functioning (https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/administration_guide/tracking_modifications_to_directory_entries) it should be unique for each backend (excluding entryusn=0 for imported and never changed entries). In our production environment (389ds v1.3.6.6) there are multiple entries having 2 exactly same entryUSN. Generally it's a group and a user entry that was added/deleted from that group.

#### Steps to reproduce

1. Probably heavy large group modifications with memberOf and entryUSN plugins enabled
2. Check dbscan -r -f entryusn.db
3. To find all duplicate entries:
 dbscan -r -f entryusn.db | tail -n +3 | grep  -B 1 '[0-9]\+ [0-9]'

#### Actual results
for some entryUSN numbers there are two entries:
=174757                                 
        9955 40108 
It is always a group and a user, so it is very probable the duplicate entryUSN is generated during memberOf plugin functioning:
cn=Groupe Example,ou=Par entite,ou=Groupes Globaux,ou=Groupes,dc=id,dc=polytechnique,dc=edu
...
uniqueMember: uid=user1,ou=Personnel,ou=Utilisateurs,dc=id,dc=polytechnique,dc=edu
...
modifyTimeStamp: 20170620133023Z
modifiersName: cn=X LDAP Root
entryUSN: 174757


uid=user1,ou=Personnel,ou=Utilisateurs,dc=id,dc=polytechnique,dc=edu
...
memberOf: cn=Groupe Example,ou=Par entite,ou=Groupes Globaux,ou=Groupes,dc=id,dc=polytechnique,dc=edu
...
modifyTimeStamp: 20170620133023Z
modifiersName: cn=X LDAP Root
entryUSN: 174757


#### Expected results
entryUSN is supposed to be unique per backend according to documentation. These duplicates are not very critical since anyway the two changed entries will be found by the filter entryUSN>=n.

Comment 3 sgouvern 2020-11-13 16:17:40 UTC
With build 389-ds-base-1.4.3.16-1.module+el8.4.0+8740+d5ec8778.x86_64


[root@ci-vm-10-0-138-157 ds]# PYTHONPATH=src/lib389/ py.test -s -v dirsrvtests/tests/suites/plugins/entryusn_test.py
re-exec with libfaketime dependencies
===================================================================== test session starts ======================================================================
platform linux -- Python 3.6.8, pytest-6.1.2, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-247.el8.x86_64-x86_64-with-redhat-8.4-Ootpa', 'Packages': {'pytest': '6.1.2', 'py': '1.9.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.10.0', 'html': '2.1.1', 'libfaketime': '0.1.2'}}
389-ds-base: 1.4.3.16-1.module+el8.4.0+8740+d5ec8778
nss: 3.53.1-11.el8_2
nspr: 4.25.0-2.el8_2
openldap: 2.4.46-16.el8
cyrus-sasl: 2.1.27-5.el8
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, configfile: pytest.ini
plugins: metadata-1.10.0, html-2.1.1, libfaketime-0.1.2
collected 3 items 
                                                                                                                                             
dirsrvtests/tests/suites/plugins/entryusn_test.py::test_entryusn_no_duplicates
PASSED
dirsrvtests/tests/suites/plugins/entryusn_test.py::test_entryusn_is_same_after_failure
PASSED
dirsrvtests/tests/suites/plugins/entryusn_test.py::test_entryusn_after_repl_delete
PASSED
=========================================================== 3 passed, 1 warning in 177.12s (0:02:57) ===========================================================

Marking as Verified:tested

Comment 6 sgouvern 2020-11-16 15:28:08 UTC
verified:tested (see comment 3) with build https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1383684 
-> marking as VERIFIED

Comment 10 errata-xmlrpc 2021-05-18 15:45:18 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 (389-ds:1.4 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-2021:1835


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