OPENDJ-1453 (CR-3870) Replica offline messages should be synced with updates
Added a new ReplicaOfflineMsg to communicate that a replica is offline. ReplicaOfflineMsg extends UpdateMsg. It is possible that OPENDJ-1260 will piggy back on this new message type.
This patch makes a DS send a ReplicaOfflineMsg to its preferred RS on shutdown.
This works when we have split DS-RS, but works only 50% (guesstimate) of the time with combined DS-RS. There is a race condition between shutdown and the ReplicaOfflineMsg being forwarded by the collocated RS.
Last but not least, RSs can communicate such ReplicaOfflineMsg to other RSs via ServerWriter / ServerReader.
Another last item: Due to current change, replication is querying the changelogstate a lot more often. This is not playing nice with ExternalChangeLogTest and GenerationIdTest and required changing the File-based changelog ReplicationEnvironment class.
It might be necessary to reduce I/O to maintain an in memory copy of the changelogstate. I might do this in a subsequent commit.
ReplicaOfflineMsg.java: ADDED
ReplicationMsg.java:
Added support for ReplicaOfflineMsg.
ProtocolVersion.java:
Updated javadoc for REPLICATION_PROTOCOL_V8.
LDAPReplicationDomain.java, ReplicationDomain.java:
Added publishReplicaOfflineMsg().
ReplicationBroker.java:
In stop(), called ReplicationDomain.publishReplicaOfflineMsg().
ReplicationServerDomain.java:
In publishUpdateMsg(UpdateMsg), handled ReplicaOfflineMsg.
PendingChange.java:
Changed msg field + getMsg() return type from LDAPUpdateMsg to UpdateMsg.
Added getLDAPUpdateMsg().
PendingChanges.java:
Added putReplicaOfflineMsg().
In pushCommittedChanges(), changed the code as a consequence of the change to PendingChange.getMsg().
RemotePendingChanges.java:
Changed the code as a consequence of the change to PendingChange.getMsg().
JEChangelogDB.java:
Added ReplicaOfflineCursor inner class, decorator for a DBCursor + used it in getCursorFrom() to return ReplicaOfflineMsg to ServerWriter thread.
JEChangelogDBTest.java: ADDED
Tested ReplicaOfflineCursor.
ECLServerHandler.java:
In getNextMessage(), ignore ReplicaOfflineMsg which are useless to searches on cn=changelog.
SynchronizationMsgTest.java:
Added a test for ReplicaOfflineMsg (de)serialization.
FakeUpdateMsg.java: ADDED, extracted from CompositeDBCursorTest
CompositeDBCursorTest.java:
Replaced call to newUpdateMsg() by calling FakeUpdateMsg ctor.
ReplicationEnvironment.java:
Fixes to make ExternalChangeLogTest and GenerationIdTest work.
replication.properties:
Removed now useless messages.