This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 60587b63a RATIS-1835. Keep nextIndex unchanged when leader sending 
heartbeat to restarting followers (#875)
60587b63a is described below

commit 60587b63a4401cc6160907d33fb5cd89dbbdc724
Author: William Song <[email protected]>
AuthorDate: Tue Apr 18 05:05:35 2023 +0800

    RATIS-1835. Keep nextIndex unchanged when leader sending heartbeat to 
restarting followers (#875)
---
 .../src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java    | 3 +++
 1 file changed, 3 insertions(+)

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 0b9ef2bd3..0b8b9f354 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
@@ -128,6 +128,9 @@ public class GrpcLogAppender extends LogAppenderBase {
           " keep nextIndex ({}) unchanged and retry.", this, f.getNextIndex());
         return;
       }
+      if (request != null && request.isHeartbeat()) {
+        return;
+      }
       getFollower().decreaseNextIndex(nextIndex);
     } catch (IOException ie) {
       LOG.warn(this + ": Failed to getClient for " + getFollowerId(), ie);

Reply via email to