ivandika3 opened a new pull request, #1700:
URL: https://github.com/apache/ratis/pull/1700

   Generated-by: GPT-6.1 Sol
   
   Please refer to https://issues.apache.org/jira/browse/RATIS-2821. 
   
   This main fix is in `LogAppenderBase#newAppendEntriesRequest`. However, 
there are also some fixes to handle cases where the nextIndex / matchIndex / 
snapshotIndex update from follower RPC reply will not cause another issue. For 
example, `increaseNextIndex` is replaced with `updateNextIndexForAppendEntries` 
since it's possible where `nextIndex` is updated and causes `increaseNextIndex` 
to faill.
   
   ```java
   Appender prepares entries 100–109
   Reply handler advances nextIndex to 150
   Appender tries to advance nextIndex to 110
   Strict increasing-index assertion fails
   ``` 
   
   The concurrency model for the indices needs to be discussed further and 
addressed in the future tasks since it might affect performance and might risk 
issues like deadlock. Possible ways
   - Use the `GrpcLogAppender` lock when updating any indices to ensure 
atomicity
   - FollowerInfoImpl can be synchronized or have a lock methods to protect the 
indices updates. Also support updating multiple indices atomically (e.g. 
nextIndex and matchIndex).
   
   ## What changes were proposed in this pull request?
   
   https://issues.apache.org/jira/browse/RATIS-2821
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-2821
   
   ## How was this patch tested?
   
   UT.
   


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