SzyWilliam commented on code in PR #914:
URL: https://github.com/apache/ratis/pull/914#discussion_r1315717305
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -433,7 +434,7 @@ private void onNextImpl(AppendEntriesReplyProto reply) {
case INCONSISTENCY:
grpcServerMetrics.onRequestInconsistency(getFollowerId().toString());
LOG.warn("{}: received {} reply with nextIndex {}", this,
reply.getResult(), reply.getNextIndex());
- updateNextIndex(reply.getNextIndex());
+ updateNextIndex(Math.max(getFollower().getMatchIndex() + 1,
reply.getNextIndex()));
Review Comment:
If a follower shutdowns, clear the logs and meta conf, and then restarts
(just as what we do in `runTestBootstrapReconf`), the leader will still
maintains the matchIndex (previously before shutdown) of this follower. The
changes here will cause the nextIndex never being correctly updated. I think we
can tolerate some inconsistent AppendEntries in trade for fault tolerance and
robustness. What do you think @szetszwo ?
--
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]