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

fdorson
13.41.2008 9381f1aa6dac9731fa688dfbebdfdf4955abc317
fix for issue #3310 : It could take up to 6 minutes to restart a master.
2 files modified
28 ■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java 13 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java 15 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java
@@ -133,7 +133,18 @@
  public ByteString normalizeValue(ByteString value)
  {
    String[] token = value.stringValue().split(":", 3);
    return new ASN1OctetString(token[1]);
    /* Change the format of the value to index and start
     * with the serverId. In that manner, the search response
     * time is optimised for a particulare serverId.
     * The format of the key is now :
     * serverId + timestamp + seqNum
     */
    String timestamp = token[1].substring(0,16);
    String serverId = token[1].substring(16,20);
    String seqNumber = token[1].substring(20, 28);
    return new ASN1OctetString(serverId + timestamp + seqNumber);
  }
  /**
opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java
@@ -703,7 +703,9 @@
  /**
   * Search for the changes that happened since fromChangeNumber
   * based on the historical attribute.
   * based on the historical attribute. The only changes that will
   * be send will be the one generated on the serverId provided in
   * fromChangeNumber.
   * @param baseDn the base DN
   * @param fromChangeNumber The change number from which we want the changes
   * @param resultListener that will process the entries returned.
@@ -718,9 +720,16 @@
  {
    InternalClientConnection conn =
      InternalClientConnection.getRootConnection();
    Short serverId = fromChangeNumber.getServerId();
    String maxValueForId = "ffffffffffffffff" +
      String.format("%04x", serverId) + "ffffffff";
    LDAPFilter filter = LDAPFilter.decode(
      "(" + Historical.HISTORICALATTRIBUTENAME +
      ">=dummy:" + fromChangeNumber + ")");
       "(&(" + Historical.HISTORICALATTRIBUTENAME + ">=dummy:"
       + fromChangeNumber + ")(" + Historical.HISTORICALATTRIBUTENAME +
       "<=dummy:" + maxValueForId + "))");
    LinkedHashSet<String> attrs = new LinkedHashSet<String>(1);
    attrs.add(Historical.HISTORICALATTRIBUTENAME);
    attrs.add(Historical.ENTRYUIDNAME);