This is an automated email from the ASF dual-hosted git repository. williamsong pushed a commit to branch snapshot-branch2 in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 7451d86a13c2550477f3db4468916162ab9010f3 Author: Potato <[email protected]> AuthorDate: Sat May 13 16:37:43 2023 +0800 RATIS-1841. Fixed bug where cluster restart failed to transfer snapshot. (#879) --- .../src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java index 61ef60b8a..1ac91e4fc 100644 --- a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java +++ b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java @@ -124,9 +124,9 @@ public class GrpcLogAppender extends LogAppenderBase { .map(AppendEntriesRequest::getPreviousLog) .map(TermIndex::getIndex) .orElseGet(f::getMatchIndex); - if (onError && f.getMatchIndex() == 0 && request == null) { - LOG.warn("{}: Follower failed when matchIndex == 0, " + - " keep nextIndex ({}) unchanged and retry.", this, f.getNextIndex()); + if (onError && request == null) { + LOG.warn("{}: Follower failed and request == null, " + + " keep nextIndex ({}) unchanged and retry.", this, f.getNextIndex()); return; } if (request != null && request.isHeartbeat()) {
