Bug 463774
Summary: | index files for database should be deleted when db is deleted. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Ade Lee <alee> | ||||||
Component: | Database - General | Assignee: | Noriko Hosoi <nhosoi> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Chandrasekar Kannan <ckannan> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 1.1.3 | CC: | benl, nkinder, yzhang | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 8.1 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-04-29 23:06:39 UTC | Type: | --- | ||||||
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: | 249650, 493682 | ||||||||
Attachments: |
|
Description
Ade Lee
2008-09-24 16:35:33 UTC
Created attachment 322659 [details]
cvs diff ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
File: ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
Fix Description: The callback ldbm_instance_post_delete_instance_entry_callback is called when the backend instance is removed. In the callback, there was a code to cleanup the primary db (id2entry.db#), but no other index files nor the instance directory. Also, the code included a bug to get the instance directory path. The proposed code gets the right instance directory path and cleans up all the files in the directory, then removes the backend instance directory.
How to verify the bug: 1) mkdir /tmp/db; then add the following entries. $ /usr/lib64/mozldap/ldapmodify -D 'cn=Directory Manager' -w <pw> -a dn: cn=testRoot,cn=ldbm database, cn=plugins, cn=config changetype: add objectClass: top objectClass: extensibleObject objectClass: nsBackendInstance cn: testRoot nsslapd-suffix: dc=test,dc=com nsslapd-cachesize: -1 nsslapd-cachememsize: 10485760 nsslapd-directory: /tmp/db/testRoot dn: cn="dc=test,dc=com",cn=mapping tree, cn=config changetype: add objectClass: top objectClass: extensibleObject objectClass: nsMappingTree nsslapd-state: Backend cn: "dc=test,dc=com" cn: dc=test,dc=com nsslapd-backend: testRoot 2) run dbgen.pl to generate an ldif file. $ dbgen.pl -s "dc=test,dc=com" -o test1k.ldif -n 1000 3) import the ldif file. ./stop-slapd ./ldif2db -n testRoot -i /path/to/test1k.ldif ./start-slapd 4) check that /tmp/db/testRoot and db files underneath exist. 5) delete the backend instance. $ /usr/lib64/mozldap/ldapdelete -D 'cn=Directory Manager' -w <pw> cn=aci, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=cn, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=encrypted attribute keys, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=encrypted attributes, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=entrydn, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=givenName, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=mailAlternateAddress, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=mail, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=mailHost, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=member, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=memberOf, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=monitor, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=nscpEntryDN, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=nsds5ReplConflict, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=nsuniqueid, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=ntUniqueId, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=ntUserDomainId, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=numsubordinates, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=objectclass, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=owner, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=parentid, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=seeAlso, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=sn, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=telephoneNumber, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=uid, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=uniquemember, cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=index, cn=testRoot, cn=ldbm database, cn=plugins, cn=config cn=testRoot,cn=ldbm database, cn=plugins, cn=config cn="dc=test,dc=com",cn=mapping tree, cn=config 6) check that /tmp/db/testRoot is removed. Created attachment 322787 [details]
cvs commit message
Reviewed by Nathan (Thank you!!)
Checked in into CVS HEAD.
verified on rhel5 i386 with console remove function : test result pass verified on rhel4 i386 with console remove function : test result pass An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-0455.html |