mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ludovicp
27.33.2010 9543e8abfda91f26c0c4ef22db9a67189bea7a1d
Fix for issue #4357. Corrected DSEE originated replication metadata processing
2 files modified
57 ■■■■ changed files
opends/src/messages/messages/replication.properties 3 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java 54 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/replication.properties
@@ -488,4 +488,5 @@
NOTICE_RESENDING_INIT_TARGET_199=\
 Resending a new initialization start for an initialization of a remote server \
 due to the root error : %s
NOTICE_ERR_WHILE_TRYING_TO_DECODE_RUV_IN_STATE_200=Error while trying to \
 translate RUV into state for suffix %s
opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.server.replication.plugin;
import org.opends.messages.Message;
@@ -505,21 +505,30 @@
   Long genId = null;
   SearchResultEntry ruvEntry = null;
   // Search the RUV in the DB
   ruvEntry = searchRUVEntry();
   if (ruvEntry == null)
     return null;
   // Check if the serverState is already initialized
   if( !isServerStateInitilized())
   try
   {
     // Translate the ruv to serverState
     // and GenerationId
     genId = initializeStateWithRUVEntry(ruvEntry);
   }
     // Search the RUV in the DB
     ruvEntry = searchRUVEntry();
     if (ruvEntry == null)
       return null;
     // Check if the serverState is already initialized
     if( !isServerStateInitilized())
     {
       // Translate the ruv to serverState
       // and GenerationId
       genId = initializeStateWithRUVEntry(ruvEntry);
     }
   }
   catch (Exception e)
   {
     Message message = NOTE_ERR_WHILE_TRYING_TO_DECODE_RUV_IN_STATE.get(
         baseDn.toString());
     logError(message);
   }
   // In any case, remove the RUV entry
   // if it exists
   DeleteOperationBasis del =  new DeleteOperationBasis(conn,
@@ -574,9 +583,24 @@
          {
            String[] bits = value.split(" ");
            // Need to take into account when a purl is empty
            if (bits.length > 3)
            {
              csn = bits[4];
              if (bits[2].contains("ldap"))
              {
                // the ldap url is present so the max csn is the 5th element
                // Example :
                // {replica 5 ldap://host:port} 494b6635000000050000 4aeab8f300
                //  0000050000
                csn = bits[4];
              }
              else
              {
                // no ldap url so the max csn is the 4th element
                // Example :
                // {replica 31842} 4a0d1ff700017c620000 4a926b6500007c620000
                csn = bits[3];
              }
              String temp = csn.substring(0, 8);
              Long timeStamp = Long.parseLong(temp, 16);