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

gbellato
03.12.2009 574b552348f1f8a8740594b35fda1297ad62bfbe
fix for issue 4028 : error 53 returned to application during reconnection

When replication is configured and when the connection between the Directory Server
and the Replication Server fails the Directory Server is reconnecting to a Replication Server.
However currently the error 53 (DSA is unwilling to perform) is returned to application
during the time of the reconnection.
This is wrong because at this time the DS is not on error.

With this change the update threads now waits for the new connection to
be established (which is fast) before being processed.
3 files modified
32 ■■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationDomain.java 15 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -642,8 +642,9 @@
    if (isolationpolicy.equals(IsolationPolicy.REJECT_ALL_UPDATES))
    {
      // this isolation policy specifies that the updates are denied
      // when the broker is not connected.
      return isConnected();
      // when the broker had problems during the connection phase
      // Updates are still accepted if the broker is currently connecting..
      return !hasConnectionError();
    }
    // we should never get there as the only possible policies are
    // ACCEPT_ALL_UPDATES and REJECT_ALL_UPDATES
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -369,7 +369,6 @@
      if (rsInfos.size() > 0)
      {
        // At least one server answered, find the best one.
        String bestServer = computeBestReplicationServer(state, rsInfos,
          serverId, baseDn, groupId);
@@ -1838,4 +1837,15 @@
      }
    }
  }
  /**
   * Check if the broker could not find any Replication Server and therefore
   * connection attempt failed.
   *
   * @return true if the server could not connect to any Replication Server.
   */
  public boolean hasConnectionError()
  {
    return connectionError;
  }
}
opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
@@ -2005,6 +2005,21 @@
  }
  /**
   * Check if the domain has a connection error.
   * A Connection error happens when the broker could not be created
   * or when the broker could not find any ReplicationServer to connect to.
   *
   * @return true if the domain has a connection error.
   */
  public boolean hasConnectionError()
  {
    if (broker != null)
      return broker.hasConnectionError();
    else
      return true;
  }
  /**
   * Get the name of the replicationServer to which this domain is currently
   * connected.
   *