You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by ta...@apache.org on 2024/09/03 09:56:07 UTC
(ratis) 01/03: RATIS-2145. Follower hangs until the next trigger to take a snapshot. (#1139)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch release-3.1.1
in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 5b8a74fc2a0e4f6c1428a565e41324322d358531
Author: z-bb <35...@users.noreply.github.com>
AuthorDate: Fri Aug 30 23:40:11 2024 +0800
RATIS-2145. Follower hangs until the next trigger to take a snapshot. (#1139)
---
.../src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java | 6 +-----
1 file changed, 1 insertion(+), 5 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 8580c4239..0229f8e84 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
@@ -435,7 +435,7 @@ public class GrpcLogAppender extends LogAppenderBase {
}
private void timeoutAppendRequest(long cid, boolean heartbeat) {
- final AppendEntriesRequest pending = pendingRequests.handleTimeout(cid, heartbeat);
+ final AppendEntriesRequest pending = pendingRequests.remove(cid, heartbeat);
if (pending != null) {
final int errorCount = replyState.process(Event.TIMEOUT);
LOG.warn("{}: Timed out {}appendEntries, errorCount={}, request={}",
@@ -955,9 +955,5 @@ public class GrpcLogAppender extends LogAppenderBase {
AppendEntriesRequest remove(long cid, boolean isHeartbeat) {
return isHeartbeat ? heartbeats.remove(cid): logRequests.remove(cid);
}
-
- public AppendEntriesRequest handleTimeout(long callId, boolean heartbeat) {
- return heartbeat ? heartbeats.remove(callId) : logRequests.get(callId);
- }
}
}