Yaolong Liu created RATIS-1872:
----------------------------------
Summary: HeartbeatAck use in-correct callId as minCallId
Key: RATIS-1872
URL: https://issues.apache.org/jira/browse/RATIS-1872
Project: Ratis
Issue Type: Sub-task
Components: server
Affects Versions: 2.5.1
Reporter: Yaolong Liu
In https://issues.apache.org/jira/browse/RATIS-1663 we add callId to all
appendLog reuest. When trigger heartbeat,we need the reply comes after the
trigger as below.
private boolean isValid(AppendEntriesReplyProto reply) {
if (reply == null || !reply.getServerReply().getSuccess()) {
return false;
}
// valid only if the reply has a later call id than the min.
return
appender.getCallIdComparator().compare(reply.getServerReply().getCallId(),
minCallId) >= 0;
}
However,the minCallId is initialize when we get heartBeatAck,this is in
correct. If the callId of our triggerHeartbeat is 10, the callId may increase
to 20 while waiting for the reply, when we receive the reply, the minCallId is
set to 20, and all heartbeat messages are considered invalid.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)