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

gbellato
30.36.2009 de31d33cb934a7ec46beedfbf25fe0f069ac0cfa
Fix for 4373 : Replication initialization can take a long time at startup

Because the list of local serverID is not initialized at startup time, the
check for new local changes in the database can last for a long time.
3 files modified
13 ■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java 8 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 3 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -119,6 +119,8 @@
  private boolean isRegistered = false;
  private static boolean initializationCompleted = true;
  /**
   * Finds the domain for a given DN.
   *
@@ -268,6 +270,7 @@
      ReplicationSynchronizationProviderCfg configuration)
  throws ConfigException
  {
    initializationCompleted = false;
    domains.clear();
    replicationServerListener = new ReplicationServerListener(configuration);
@@ -307,6 +310,8 @@
    DirectoryServer.registerSupportedControl(
        ReplicationRepairRequestControl.OID_REPLICATION_REPAIR_CONTROL);
    initializationCompleted = true;
  }
  /**
@@ -843,6 +848,9 @@
   */
  public static boolean isLocalServerId(Integer serverId)
  {
    if (!initializationCompleted)
      return true;
    for (LDAPReplicationDomain domain : domains.values())
    {
      if (domain.getServerId() == serverId)
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -1608,7 +1608,8 @@
    // Copy the list of domains as a new domain may arrive or disappear between
    // the initializeMonitorData and completeMonitorData calls
    List<ReplicationServerDomain> rsdList = new ArrayList(baseDNs.values());
    List<ReplicationServerDomain> rsdList =
                new ArrayList<ReplicationServerDomain>(baseDNs.values());
    for (ReplicationServerDomain domain : rsdList)
    {
opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -164,7 +164,7 @@
   */
  private MonitorData monitorData = new MonitorData();
  private MonitorData wrkMonitorData;
  private Object monitorDataLock = new Object();
  private final Object monitorDataLock = new Object();
  /**
   * The needed info for each received assured update message we are waiting