You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "SzyWilliam (via GitHub)" <gi...@apache.org> on 2023/04/17 16:02:09 UTC

[GitHub] [ratis] SzyWilliam opened a new pull request, #875: RATIS-1835. Keep nextIndex unchanged when leader sending heartbeat to restarting followers

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

   see https://issues.apache.org/jira/browse/RATIS-1835.
   
   When a new leader is elected and start sending heartbeats to followers, it will first send out an empty appendEntries RPC. If the target follower is down and this heartbeat fails, the nextIndex of this follower will be set to 0.  see [Here](https://github.com/apache/ratis/blob/master/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java#L122-L131)
   
   However, this strategy may cause unexpected errors. 
   
   The leader will send a snapshot to the follower if the log with index 0 is not present. If the follower's log is fresher than this snapshot, an `IllegalStateException` will be thrown and the system cannot recover from this state. See [here](https://github.com/apache/ratis/blob/master/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java#L177-L179).
   
   Therefore, this PR proposes to keep the nextIndex unchanged in `onError`::`resetClient`.


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] szetszwo merged pull request #875: RATIS-1835. Keep nextIndex unchanged when leader sending heartbeat to restarting followers

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo merged PR #875:
URL: https://github.com/apache/ratis/pull/875


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org