szetszwo commented on code in PR #914:
URL: https://github.com/apache/ratis/pull/914#discussion_r1316078058
##########
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:
> ... clears the logs and meta conf, ...
The follower cannot clear the existing log. Otherwise, the committed
entries can be removed. As an example, see the description of RATIS-1677.
BTW, `runTestBootstrapReconf` is starting new peers but not removing existing
logs.
> ... Match index in FollowerInfoImpl is only allowed to be changed
monotonously. ...
Once the log entries are matched, it cannot be changed to unmatched later
on. This is an assumption of the Raft algorithm.
--
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]