[ 
https://issues.apache.org/jira/browse/RATIS-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze reassigned RATIS-1872:
---------------------------------

    Component/s: Linearizable Read
       Assignee: Tsz-wo Sze

[~liuyaolong], you are right that it will have a better performance if we send 
the minCallId when triggering heartbeat.

Fortunately, the current implementation does not affect the correctness of the 
Read Index algorithm.  It just unnecessarily takes a longer time.

> 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: Linearizable Read, server
>    Affects Versions: 2.5.1
>            Reporter: Yaolong Liu
>            Assignee: Tsz-wo Sze
>            Priority: Critical
>
> 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.
> {code:java}
> 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;
>     }
> {code}
> 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)

Reply via email to