ivandika3 commented on PR #1362:
URL: https://github.com/apache/ratis/pull/1362#issuecomment-3981843455

   @szetszwo Thanks for the insight about the issue and the possible idea to 
fix this. 
   
   IMO storing the read replies implementation is going to be quite involved 
(which might hide other subtle correctness issue) and there might be some 
overhead in managing the pending read replies. 
   
   The way I see it is that the current repliedIndex has two main benefits:
   1. RepliedIndex <= AppliedIndex so that the follower waitToAdvance latency 
is lower
   2. Coarser and discrete `appliedIndex` update which means that within that 
batch interval the `ReadIndex` should remain the same
   
   How about we simply update the `repliedIndex` to the current leader's 
`appliedIndex` in `ReplyFlusher#flush`? This means that we will lose the 
benefit 1, but still retrain benefit 2. Since the leader appliedIndex >= 
follower appliedIndex, the stale read issue should not happen. Let me know what 
you think.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to