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.
| | |
| | | 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 |
| | |
| | | |
| | | if (rsInfos.size() > 0) |
| | | { |
| | | |
| | | // At least one server answered, find the best one. |
| | | String bestServer = computeBestReplicationServer(state, rsInfos, |
| | | serverId, baseDn, groupId); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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. |
| | | * |