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

gbellato
17.23.2009 29a29c4fb099630685df243f32330968be6a1954
fix for 3315 : dsreplication initialize-all returns before peer has completed initialization

With this change the server code below dsreplication initialize-all
now uses the replication monitoring to make sure that all
replicas have completed the import before returning.


1 files modified
27 ■■■■■ changed files
opends/src/server/org/opends/server/replication/service/ReplicationDomain.java 27 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
@@ -1199,6 +1199,33 @@
  throws DirectoryException
  {
    initializeRemote(target, serverID, initTask);
    if (target == RoutableMsg.ALL_SERVERS)
    {
      // Check for the status of all remote servers to check if they
      // are all finished with the import.
      boolean done = true;
      do
      {
        done = true;
        for (DSInfo dsi : getReplicasList())
        {
          if (dsi.getStatus() == ServerStatus.FULL_UPDATE_STATUS)
          {
            done = false;
            try
            {
              Thread.sleep(100);
            } catch (InterruptedException e)
            {
              // just loop again.
            }
            break;
          }
        }
      }
      while (!done);
    }
  }
  /**