You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by ad...@apache.org on 2023/04/27 18:06:15 UTC
[ratis] 01/04: RATIS-1835. Keep nextIndex unchanged when leader sending heartbeat to restarting followers (#875)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/ratis.git
commit b221e6226878a8a56ccc8bd44c6372e102eccc94
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Tue Apr 18 05:05:35 2023 +0800
RATIS-1835. Keep nextIndex unchanged when leader sending heartbeat to restarting followers (#875)
(cherry picked from commit 60587b63a4401cc6160907d33fb5cd89dbbdc724)
---
.../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 bf7a872d2..61ef60b8a 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
@@ -129,6 +129,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);