Bug 1236656 - reindex off-line twice could provoke index corruption
Summary: reindex off-line twice could provoke index corruption
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
Petr Bokoc
URL:
Whiteboard:
Depends On:
Blocks: 1237325
TreeView+ depends on / blocked
 
Reported: 2015-06-29 16:30 UTC by German Parente
Modified: 2020-09-13 21:26 UTC (History)
7 users (show)

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.
Clone Of:
: 1237325 (view as bug list)
Environment:
Last Closed: 2016-05-10 19:19:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ldif used to reproduce the issue. (1.32 KB, application/x-gzip)
2015-06-29 21:29 UTC, German Parente
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 1543 0 None None None 2020-09-13 21:26:56 UTC
Red Hat Product Errata RHBA-2016:0737 0 normal SHIPPED_LIVE 389-ds-base bug fix and enhancement update 2016-05-10 22:29:13 UTC

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


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