Issue Details (XML | Word | Printable)

Key: DIRSERVER-307
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alex Karasulu
Reporter: Endi S. Dewata
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Duplicate root entry gets added everytime restarting the server

Created: 31/Aug/05 09:58 AM   Updated: 10/Feb/06 12:34 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch_DIREVE-240.txt 2005-09-01 12:30 AM Stefan Zoerner 0.8 kB
Issue Links:
Reference
 

Resolution Date: 12/Sep/05 04:13 AM


 Description  « Hide
Duplicate root entry gets added everytime restarting the server.

Steps to reproduce:
1. Start the server:
    java -jar main/target/apacheds-main-0.9.3-SNAPSHOT.jar main/server.xml

2. Use a command line ldapsearch, execute the following:
    ldapsearch -h localhost -p 10389 -b "dc=apache,dc=org"
    It returns an entry: dc=apache,dc=org.

3. Restart the server.

4. Execute the same search operation.
    This time it returns 2 entries, both are: dc=apache,dc=org.

The more you restart the server, the more duplicate entries you will get. Note: if you use an LDAP browser you probably won't see this problem.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Stefan Zoerner added a comment - 31/Aug/05 08:34 PM
It is quite easy to reproduce this one, thanks to Endi's detailed instractions.
Comments:
My complete search command looked like this

$ ldapsearch -h localhost -p 10389 -b "dc=apache,dc=org" -s sub "(objectclass=*)"

Using the base scope displays only one entry -- this is probably the cause, why the problem does not show up in the GUI tools I checked (as Endi assumed).
I was not able to create yet another "dc=apache,dc=org" entry on an already running ApacheDS from outside by using ldapmodify (entry is rejected as expected). But it is possible to create entries with different attribute value sets by changing the server.xml configuration between startups.

This leads to the question, what the correct behaviour is, if someone changes the configuration here (add some attributes, for example). The LDAP servers I know have the suffixes as a part of the configuration, but adding a new suffix does not automatically add a corresponding entry. This has to be done after server startup, manually.

Stefan Zoerner added a comment - 01/Sep/05 12:30 AM
Two more comments:
1. The issue exists on the system partition as well.
2. I made a change to the BTreeContextPartition.java file (patch attached)

The patch adds a conditional to the init method. It checks wether the entry for the suffix exists. If not, it creates it.
This should remove at least the problem Endi described in this issue (a skilled person shall check, whether this is a clever change).

But I am unsure, whether it helps to fix other problems, which may arise if sb changes the configuration for the partition between startups in the server.xml (e.g. add some attributes in contextEntry or indexedAttributes ...).

Stefan Zoerner made changes - 01/Sep/05 12:30 AM
Field Original Value New Value
Attachment patch_DIREVE-240.txt [ 12312110 ]
Repository Revision Date User Message
ASF #280166 Sun Sep 11 19:03:45 UTC 2005 akarasulu Reviewed and applyed Stefan Zoerner's patch for DIREVE-240 here:

    http://issues.apache.org/jira/browse/DIREVE-240
Files Changed
MODIFY /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/BTreeContextPartition.java

Alex Karasulu made changes - 12/Sep/05 01:44 AM
Status Open [ 1 ] In Progress [ 3 ]
Alex Karasulu added a comment - 12/Sep/05 04:12 AM
make the link for tracking in the future

Alex Karasulu made changes - 12/Sep/05 04:12 AM
Link This issue is related to DIREVE-249 [ DIREVE-249 ]
Alex Karasulu added a comment - 12/Sep/05 04:13 AM
Committed in revision 280166 here:

http://svn.apache.org/viewcvs.cgi?view=rev&rev=280166

Alex Karasulu made changes - 12/Sep/05 04:13 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Alex Karasulu made changes - 12/Sep/05 04:18 AM
Fix Version/s 0.9.3 [ 12310193 ]
Endi S. Dewata added a comment - 13/Sep/05 03:32 AM
The fix has been verified. Thanks.

Endi S. Dewata made changes - 13/Sep/05 03:32 AM
Status Resolved [ 5 ] Closed [ 6 ]
Alex Karasulu made changes - 10/Feb/06 12:34 PM
Fix Version/s 0.9.3 [ 12310193 ]
Component/s jdbm database [ 11450 ]
Key DIREVE-240 DIRSERVER-307
Affects Version/s 0.9.3 [ 12310193 ]
Project Directory Server [ 10516 ] Directory ApacheDS [ 12310260 ]