Brokenice0415 commented on code in PR #914:
URL: https://github.com/apache/ratis/pull/914#discussion_r1315906356


##########
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:
   Maybe decreasing the match index according to inconsistency reply's next 
index information is better? Match index in `FollowerInfoImpl` is only allowed 
to be changed monotonously. This way will break that. I have no idea which way 
is better, tolerating this inconsistent or breaking the monotonous increasing 
of match index.



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