Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1236656

Summary: reindex off-line twice could provoke index corruption
Product: Red Hat Enterprise Linux 6 Reporter: German Parente <gparente>
Component: 389-ds-baseAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact: Petr Bokoc <pbokoc>
Priority: medium    
Version: 6.6CC: hmiura, jentrena, jgalipea, nkinder, pbokoc, rmeggins, tscherf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.11.15-67.el6 Doc Type: Bug Fix
Doc Text:
`nsMatchingRule` is now correctly applied to attribute information Previously, when `nsMatchingRule` was dynamically updated in an index entry, the value was not applied to the attribute information. This caused the *dbverify* utility to report database corruption in error. In this release, `nsMatchingRule` changes are correctly applied to attribute information, and *dbverify* no longer falsely reports database corruption.
Story Points: ---
Clone Of:
: 1237325 (view as bug list) Environment:
Last Closed: 2016-05-10 19:19:42 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1237325    
Attachments:
Description Flags
ldif used to reproduce the issue. none

Description German Parente 2015-06-29 16:30:43 UTC
Description of problem:

thanks a lot Hiroko Miura for pointing this issue.

Customer is reindexing several times same attribute using the console (on-line reindex). Second time using a matching rule.

The index shows corrupt by using dbverify.



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

389-ds-base-1.2.11.15-50



How reproducible: rather always.


Steps to Reproduce:

1. create instance / suffix 

2. import 60 entries of this shape:

dn: uid=user2,ou=people,o=redhat
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetorgperson
objectclass: posixAccount
uid: user2
userpassword: user2
uidnumber: 2
gidnumber: 2
cn: user2
sn: user2

3. Add index by uidnumber:


dn: cn=uidnumber,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass: top
objectClass: nsIndex
cn: uidnumber
nsSystemIndex: false
nsIndexType: pres
nsIndexType: eq

4. Apply index

/usr/lib64/dirsrv/slapd-server2/db2index.pl -n userroot -D "cn=directory manager" -w secret12 -t uidnumber

5. wait for the reindex to be finished.

6. modify index in this way:

dn: cn=uidnumber,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config
changetype: modify
add: nsMatchingRule
nsMatchingRule: integerOrderingMatch

7. Re-apply index
/usr/lib64/dirsrv/slapd-server2/db2index.pl -n userroot -D "cn=directory manager" -w secret12 -t uidnumber

8. Stop server           

9. Run dbverify

[root@rh6 ~]# /usr/lib64/dirsrv/slapd-server2/dbverify
[29/Jun/2015:18:25:33 +0200] - libdb: Page 1: out-of-order key at entry 124
[29/Jun/2015:18:25:33 +0200] - libdb: Page 1: out-of-order key at entry 146
[29/Jun/2015:18:25:33 +0200] - libdb: Page 1: out-of-order key at entry 168
[29/Jun/2015:18:25:33 +0200] - libdb: Page 1: out-of-order key at entry 190
[29/Jun/2015:18:25:33 +0200] - libdb: /var/lib/dirsrv/slapd-server2/db/userRoot/uidnumber.db4: DB_VERIFY_BAD: Database verification failed
[29/Jun/2015:18:25:33 +0200] DB verify - verify failed(-30972): /var/lib/dirsrv/slapd-server2/db/userRoot/uidnumber.db4


Actual results:

index corrupted.

Expected results:

not corrupted.

Additional info:

Easy workaround: reindex off-line.

Comment 5 German Parente 2015-06-29 21:29:53 UTC
Created attachment 1044469 [details]
ldif used to reproduce the issue.

Comment 8 Noriko Hosoi 2015-06-30 19:52:05 UTC
Unfortunately, it's too late for RHEL-6.7.  

Resetting the target version to rhel-6.8.0.

Comment 9 Noriko Hosoi 2015-06-30 19:54:17 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/48212

Comment 13 Viktor Ashirov 2016-02-23 14:20:27 UTC
Build tested: 389-ds-base-1.2.11.15-73.el6.x86_64

[root@rhel6ds 1236656]# sh -x reproducer.sh 
+ resetds.sh
Removing instances.
Removing instance [/etc/dirsrv/slapd-rhel6ds]
Setting up new instance.
SUCCESS ! Elapsed time: 12 sec
+ ldclt -h localhost -p 389 -D 'cn=Directory Manager' -w Secret123 -b ou=people,dc=example,dc=com -I 68 -e add,commoncounter -e 'object=posix_users.ldif,rdn=uid:[A=INCRNNOLOOP(0;100;5)]'
ldclt version 4.23
ldclt[16278]: Starting at Tue Feb 23 15:16:30 2016

ldclt[16278]: T004: Hit top incrementeal value
ldclt[16278]: T004: thread is dead.
ldclt[16278]: T005: Hit top incrementeal value
ldclt[16278]: T005: thread is dead.
ldclt[16278]: T006: Hit top incrementeal value
ldclt[16278]: T006: thread is dead.
ldclt[16278]: T007: Hit top incrementeal value
ldclt[16278]: T007: thread is dead.
ldclt[16278]: T008: Hit top incrementeal value
ldclt[16278]: T008: thread is dead.
ldclt[16278]: T009: Hit top incrementeal value
ldclt[16278]: T009: thread is dead.
ldclt[16278]: T002: Hit top incrementeal value
ldclt[16278]: T002: thread is dead.
ldclt[16278]: T003: Hit top incrementeal value
ldclt[16278]: T003: thread is dead.
ldclt[16278]: T001: Hit top incrementeal value
ldclt[16278]: T001: thread is dead.
ldclt[16278]: T000: Hit top incrementeal value
ldclt[16278]: T000: thread is dead.
ldclt[16278]: Average rate:   10.10/thr  (  10.10/sec), total:    101
ldclt[16278]: Average rate:    0.00/thr  (   0.00/sec), total:      0
ldclt[16278]: All threads are dead - exit.
ldclt[16278]: Global average rate:   10.10/thr  (  5.05/sec), total:    101
ldclt[16278]: Global number times "no activity" reports: never
ldclt[16278]: Global number of dead threads: 10
ldclt[16278]: Global no error occurs during this session.
ldclt[16278]: Ending at Tue Feb 23 15:16:50 2016
ldclt[16278]: Exit status 0 - No problem during execution.
+ ldapadd -D 'cn=Directory Manager' -w Secret123
adding new entry "cn=uidnumber,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config"

+ /usr/lib64/dirsrv/slapd-rhel6ds/db2index.pl -n userRoot -D 'cn=Directory Manager' -w Secret123 -t uidnumber
adding new entry "cn=db2index_2016_2_23_15_16_50, cn=index, cn=tasks, cn=config"

+ sleep 30
+ ldapadd -D 'cn=Directory Manager' -w Secret123
modifying entry "cn=uidnumber,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config"

+ /usr/lib64/dirsrv/slapd-rhel6ds/db2index.pl -n userRoot -D 'cn=Directory Manager' -w Secret123 -t uidnumber
adding new entry "cn=db2index_2016_2_23_15_17_21, cn=index, cn=tasks, cn=config"

+ stop-dirsrv
Stopping instance "rhel6ds"
+ /usr/lib64/dirsrv/slapd-rhel6ds/dbverify
DB verify: Passed


Marking as VERIFIED.

Comment 15 errata-xmlrpc 2016-05-10 19:19:42 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://rhn.redhat.com/errata/RHBA-2016-0737.html