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

Matthew Swift
15.26.2011 5747ebd0a8cab8dc034b88493027f04435723c0c
Fix issue OPENDJ-48: Draft ECL: lastChangeNumber still not calculated correctly 
https://bugster.forgerock.org/jira/browse/OPENDJ-48
2 files modified
13 ■■■■■ changed files
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 5 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 8 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 */
package org.opends.server.replication.server;
import static org.opends.messages.ReplicationMessages.*;
@@ -1965,7 +1966,6 @@
    int firstDraftCN;
    int lastDraftCN;
    boolean DraftCNdbIsEmpty;
    Long newestDate = 0L;
    DraftCNDbHandler draftCNDbH = this.getDraftCNDbHandler();
@@ -1976,14 +1976,11 @@
    String domainForLastSeqnum = null;
    if (firstDraftCN < 1)
    {
      DraftCNdbIsEmpty=true;
      firstDraftCN = 0;
      lastDraftCN = 0;
    }
    else
    {
      DraftCNdbIsEmpty=false;
      // Get the last DraftCN from the DraftCNdb
      lastDraftCN = draftCNDbH.getLastKey();
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 */
package org.opends.server.replication.server;
@@ -3427,7 +3428,6 @@
   */
  public long getEligibleCount(ServerState startState, ChangeNumber endCN)
  {
    long sidRes = 0;
    long res = 0;
    // Parses the dbState of the domain , server by server
@@ -3440,7 +3440,7 @@
      ChangeNumber startCN = null;
      if (startState.getMaxChangeNumber(sid) != null)
        startCN = startState.getMaxChangeNumber(sid);
      sidRes += getCount(sid, startCN, endCN);
      long sidRes = getCount(sid, startCN, endCN);
      // The startPoint is excluded when counting the ECL eligible changes
      if ((startCN!=null)&&(sidRes>0))
@@ -3461,7 +3461,6 @@
   */
  public long getEligibleCount(ChangeNumber startCN, ChangeNumber endCN)
  {
    long sidRes = 0;
    long res = 0;
    // Parses the dbState of the domain , server by server
@@ -3473,8 +3472,7 @@
      int sid = serverIDIterator.next();
      ChangeNumber lStartCN =
        new ChangeNumber(startCN.getTime(), startCN.getSeqnum(), sid);
      sidRes += getCount(sid, lStartCN, endCN);
      res+=sidRes;
      res+=getCount(sid, lStartCN, endCN);
    }
    return res;
  }