Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 619595 - Upgrading sub suffix under non-normalized suffix disappears
Upgrading sub suffix under non-normalized suffix disappears
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Retired
Component: Migration (Show other bugs)
1.2.6
All Linux
high Severity medium
: ---
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
:
Depends On:
Blocks: 389_1.2.6 639035
  Show dependency treegraph
 
Reported: 2010-07-29 17:16 EDT by Noriko Hosoi
Modified: 2015-12-07 12:02 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 12:02:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
git patch file (master) (7.94 KB, patch)
2010-07-29 21:08 EDT, Noriko Hosoi
nkinder: review+
Details | Diff

  None (edit)
Description Noriko Hosoi 2010-07-29 17:16:14 EDT
Description of problem:
1) Install 389 v1.2.5
2) Create a suffix "dc=example,  dc=com" (space(s) between dc=example and dc=com)
3) Create a sub suffix "dc=sub,dc=example,  dc=com" (backend name subexample)
4) Import entries to "ec=example,  dc=com" and "dc=sub,dc=example,  dc=com" (entry count does not matter)
5) Upgrade to 389 v1.2.6
6) Check /var/log/dirsrv/slapd-ID/errors to see if reindexing sub suffix failed:
[..] upgrade DB - subexample: Start upgradedb.
[..] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database
[..] - reindex subexample: Index buffering enabled with bucket size 100
[..] entryrdn-index - _entryrdn_insert_key: Suffix "dc=example,dc=com" not found: DB_NOTFOUND: No matching key/data pair found(-30988)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[..] - reindex subexample: Error writing entryrdn index (error -30988: DB_NOTFOUND: No matching key/data pair found)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[..] - reindex subexample: Aborting all Reindexing threads...
[..] - reindex subexample: Reindexing threads aborted.
[..] - reindex subexample: Closing files...
[..] - All database threads now stopped
[..] - reindex subexample: Reindexing failed.
[..] upgrade DB - upgradedb: Failed to upgrade database subexample
7) Check the dbdir /var/lib/dirsrv/slapd-ID/db/subexample exists or not:
# ls /var/lib/dirsrv/slapd-ID/db/
DBVERSION  guardian  log.0000000001  NetscapeRoot  NetscapeRoot.orig  userRoot
If exists, check the contents of id2entry.db4 using the dbscan utility.

[Problem description]
On v1.2.5, the sub suffix is created as follows in the configuration file dse.ldif.  The issue is nsslapd-parent-suffix, which contains the raw parent DN including the space(s) between dc=example and dc=com:
 dn: cn="dc=sub,dc=example,  dc=com",cn=mapping tree, cn=config
 objectclass: top
 objectclass: extensibleObject
 objectclass: nsMappingTree
 nsslapd-state: Backend
 cn: "dc=sub,dc=example,  dc=com"
 cn: dc=sub,dc=example,  dc=com
 nsslapd-parent-suffix: "dc=example,  dc=com"
 nsslapd-backend: subexample

When the server starts, mapping tree is constructed using the internal search.  For the sub suffix "dc=sub, dc=example,  dc=com", it's supposed to be found by the search with this filter:
  "(&(objectclass=nsMappingTree) \
    (|(nsslapd-parent-suffix=\"dc=example,dc=com\") \
     (nsslapd-parent-suffix=dc=example,dc=com)))"
For the search to return the dc=sub entry, nsslapd-parent-suffix value should be normalized by DN normalizer.  But since nsslapd-parent-suffix was missing in the schema definitions, it's considered a string and not normalized.  This leaves "dc=sub,dc=example,  dc=com" not putting into the mapping tree, which causes the entryrdn reindex fail.
Comment 2 Noriko Hosoi 2010-07-29 21:08:02 EDT
Created attachment 435442 [details]
git patch file (master)

Fix Description:
The cause of this problem is the config attribute nsslapd-parent-suffix
was not defined as an attribute of DN syntax.  Because of the missing
definition, the value is not the target of the DN normalization and
the match fails after upgraded.  Adding the attribute to the schema
solves this problem.

Plus upgradedb does backup the DB before upgrade, and if it fails
it restores from the backed up DB.  Use dblayer_restore instead
of copying DB files one by one.
Comment 4 Noriko Hosoi 2010-07-30 19:08:29 EDT
Pushed to master:

$ git push
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (20/20), 4.20 KiB, done.
Total 20 (delta 16), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   5ae0c1b..666873d  master -> master

Pushed to 389-ds-base-1.2.6:

$ git push origin ds126-local:389-ds-base-1.2.6
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (20/20), 4.28 KiB, done.
Total 20 (delta 16), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   af5c96e..d67bb39  ds126-local -> 389-ds-base-1.2.6
Comment 5 Noriko Hosoi 2011-07-26 19:56:12 EDT
This bug is supposed to verify in the upgrade test.
On the older version, prepare a suffix which is not normalized, e.g.:
  dc=example,   dc=com
and a sub suffix under it:
  ou=sub,dc=example,  dc=com

Upgrade it to DS9.0.
. Check the error log. The following error should not be observed:
  entryrdn-index - _entryrdn_insert_key: Suffix "dc=example,dc=com" not
  found: DB_NOTFOUND: No matching key/data pair found(-30988)
. The sub suffix ou=sub,dc=example,dc=com should exist after the upgrade.
If these 2 are satisfied, this bug is verified.
Comment 6 Amita Sharma 2011-08-16 05:57:10 EDT
followed comment#5 to test -
1. I have created the sub-suffix on source under dc=example,dc=com as ou=sub,dc=example,dc=com from the console on DS8.2(rhel5)
2. Migrated to DS9.0 on rhel6.1
Upgrade it to DS9.0.
. Check the error log. The following error should not be observed:
  entryrdn-index - _entryrdn_insert_key: Suffix "dc=example,dc=com" not
  found: DB_NOTFOUND: No matching key/data pair found(-30988)
. The sub suffix ou=sub,dc=example,dc=com should exist after the upgrade.
Both are satisfied.

Hence marking the bug as VERIFIED.

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