SzyWilliam commented on PR #926:
URL: https://github.com/apache/ratis/pull/926#issuecomment-1733113212

   @OneSizeFitsQuorum thanks a lot for the reviews!
   > I checked the example in the 
[issue](https://issues.apache.org/jira/browse/RATIS-1883) that introduced this 
problem, and I feel that the 7th step in the middle might be a typo; it should 
probably indicate that it was log [5].
   
   It's a bit tricky. The log[4] follower received in 7th step is sent by step 
3, not by step 6.
   
   > If we reduce nextIndex in response to a smaller matchIndex + 1, even we 
fix this exception in this pr, it would still lead to the retransmission of 
many logs that have already been sent, which may affect write performance 
seriously when pipeline is full.
   
   I agree that we should not reduce nextIndex, and that's why original pr uses 
`increaseNextIndex`. `updateNextIndex` also will not reduce nextIndex. However, 
the difference between `increaseNextIndex` and `updateNextIndex` is that,
   * `increaseNextIndex` requires caller to make sure the updated value is 
larger, or an `IllegalStateException` will be thrown.
   * `updateNextIndex` will only update when the provided value is larger than 
original one.


-- 
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