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

Jean-Noel Rouvignac
20.52.2013 7d731aeb05c09539359d51cd5929cc571b7a3967
OPENDJ-1231 Make the Medium Consistency Point support replica heartbeats

Christophe reported to me that functional tests with the changeNumber were failing.
After investigation on my side, it turns out that the mediumConsistencyCSN was blocked on a "cn=admin data" or "cn=schema" CSN.
Fix consists in excluding these domains in ChangeNumberIndexer's publishHeartbeat() and publishUpdateMsg() methods.


ChangeNumberIndexer.java:
Added isExcludedFromECL() + used it from publishHeartbeat() and publishUpdateMsg() to exclude undesired domains.
1 files modified
17 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java
@@ -37,6 +37,7 @@
import org.opends.server.replication.common.CSN;
import org.opends.server.replication.common.MultiDomainServerState;
import org.opends.server.replication.common.ServerState;
import org.opends.server.replication.plugin.MultimasterReplication;
import org.opends.server.replication.protocol.UpdateMsg;
import org.opends.server.replication.server.ChangelogState;
import org.opends.server.replication.server.changelog.api.*;
@@ -175,6 +176,11 @@
   */
  public void publishHeartbeat(DN baseDN, CSN heartbeatCSN)
  {
    if (isExcludedFromECL(baseDN))
    {
      return;
    }
    lastAliveCSNs.update(baseDN, heartbeatCSN);
    tryNotify(baseDN);
  }
@@ -192,6 +198,11 @@
  public void publishUpdateMsg(DN baseDN, UpdateMsg updateMsg)
      throws ChangelogException
  {
    if (isExcludedFromECL(baseDN))
    {
      return;
    }
    final CSN csn = updateMsg.getCSN();
    lastAliveCSNs.update(baseDN, csn);
    // only keep the oldest CSN that will be the new cursor's starting point
@@ -199,6 +210,12 @@
    tryNotify(baseDN);
  }
  private boolean isExcludedFromECL(DN baseDN)
  {
    Set<String> excludedDNs = MultimasterReplication.getECLDisabledDomains();
    return excludedDNs.contains(baseDN.toNormalizedString());
  }
  /**
   * Returns the last time each serverId was seen alive for the specified
   * replication domain.