{
// Assured feature is supported starting from replication protocol V2
if (broker.getProtocolVersion() >=
ProtocolVersion.REPLICATION_PROTOCOL_V2)
{
AssuredMode msgAssuredMode = msg.getAssuredMode();
if (msgAssuredMode == AssuredMode.SAFE_READ_MODE)
{
if (rsGroupId == groupId)
{
// Send the ack
AckMsg ackMsg = new AckMsg(msg.getChangeNumber());
if (replayErrorMsg != null)
{
// Mark the error in the ack
// -> replay error occured
ackMsg.setHasReplayError(true);
// -> replay error occured in our server
List<Integer> idList = new ArrayList<Integer>();
idList.add(serverID);
ackMsg.setFailedServers(idList);
}
broker.publish(ackMsg);
if (replayErrorMsg != null)
{
assuredSrReceivedUpdatesNotAcked.incrementAndGet();
} else
{
assuredSrReceivedUpdatesAcked.incrementAndGet();
}
}
} else if (assuredMode != AssuredMode.SAFE_DATA_MODE)
{
Message errorMsg = ERR_DS_UNKNOWN_ASSURED_MODE.get(
Integer.toString(serverID), msgAssuredMode.toString(), serviceID,
msg.toString());
logError(errorMsg);
} else
{
// In safe data mode assured update that comes up to a DS requires no