OPENDJ-2106 (CR-7228) Entry is not replicated on second instance in 2 RS topology
A bit of context:
This code is executed by the RS which sends changes to a connected DS.
Fixed the logic in MessageHandler.fillLateQueue() which seemed flawed and even dangerous (because the connected DSs collection changes dynamically with the topology, and DSs can change their preferred RS). This is inherited from the 2.6 code worked: it did not have a global view of the changelog and specifically opened cursors for the connected DSs.
Given a replication change, the only DS we do not want to send it to is the originating DS itself.
MessageHandler.java:
In getNextMessage(), replaced the parameter Set<Integer> connectedReplicaIds with int sendToServerId and removed synchronous parameter (useless).
ServerHandler.java:
In take(), removed "Set<Integer> connectedReplicaIds" parameter.
Extracted methods acquirePermitInSendWindow() and incrementAssuredStats().
Inlined incrementAssuredSdSentUpdates() and incrementAssuredSrSentUpdates().
ReplicationServerDomain.java, ServerWriter.java:
Inlined ReplicationServerDomain.take().