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 69ec8f436 RATIS-2135. The leader keeps sending inconsistent entries
repeatedly to followers. (#1132)
69ec8f436 is described below
commit 69ec8f43621e30c7bddb032e8b2c18533a86053e
Author: Tsz-Wo Nicholas Sze <[email protected]>
AuthorDate: Mon Aug 12 09:22:51 2024 -0700
RATIS-2135. The leader keeps sending inconsistent entries repeatedly to
followers. (#1132)
---
.../org/apache/ratis/grpc/server/GrpcService.java | 23 ++++++++--------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git
a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcService.java
b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcService.java
index e3c0a5edd..0802226f7 100644
--- a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcService.java
+++ b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcService.java
@@ -65,8 +65,7 @@ public final class GrpcService extends
RaftServerRpcWithProxy<GrpcServerProtocol
class AsyncService implements RaftServerAsynchronousProtocol {
@Override
- public CompletableFuture<AppendEntriesReplyProto>
appendEntriesAsync(AppendEntriesRequestProto request)
- throws IOException {
+ public CompletableFuture<AppendEntriesReplyProto>
appendEntriesAsync(AppendEntriesRequestProto request) {
throw new UnsupportedOperationException("This method is not supported");
}
@@ -99,7 +98,6 @@ public final class GrpcService extends
RaftServerRpcWithProxy<GrpcServerProtocol
public static final class Builder {
private RaftServer server;
- private GrpcTlsConfig tlsConfig;
private GrpcTlsConfig adminTlsConfig;
private GrpcTlsConfig clientTlsConfig;
private GrpcTlsConfig serverTlsConfig;
@@ -115,11 +113,6 @@ public final class GrpcService extends
RaftServerRpcWithProxy<GrpcServerProtocol
return new GrpcService(server, adminTlsConfig, clientTlsConfig,
serverTlsConfig);
}
- public Builder setTlsConfig(GrpcTlsConfig tlsConfig) {
- this.tlsConfig = tlsConfig;
- return this;
- }
-
public Builder setAdminTlsConfig(GrpcTlsConfig config) {
this.adminTlsConfig = config;
return this;
@@ -134,10 +127,6 @@ public final class GrpcService extends
RaftServerRpcWithProxy<GrpcServerProtocol
this.serverTlsConfig = config;
return this;
}
-
- public GrpcTlsConfig getTlsConfig() {
- return tlsConfig;
- }
}
public static Builder newBuilder() {
@@ -192,10 +181,14 @@ public final class GrpcService extends
RaftServerRpcWithProxy<GrpcServerProtocol
super(idSupplier, id -> new PeerProxyMap<>(id.toString(),
p -> new GrpcServerProtocolClient(p, flowControlWindow.getSizeInt(),
requestTimeoutDuration, serverTlsConfig, useSeparateHBChannel)));
- if (appenderBufferSize.getSize() > grpcMessageSizeMax.getSize()) {
+
+ final SizeInBytes gap = SizeInBytes.ONE_MB;
+ final long diff = grpcMessageSizeMax.getSize() -
appenderBufferSize.getSize();
+ if (diff < gap.getSize()) {
throw new IllegalArgumentException("Illegal configuration: "
- + RaftServerConfigKeys.Log.Appender.BUFFER_BYTE_LIMIT_KEY + " = " +
appenderBufferSize
- + " > " + GrpcConfigKeys.MESSAGE_SIZE_MAX_KEY + " = " +
grpcMessageSizeMax);
+ + GrpcConfigKeys.MESSAGE_SIZE_MAX_KEY + "(= " + grpcMessageSizeMax
+ + ") must be " + gap + " larger than "
+ + RaftServerConfigKeys.Log.Appender.BUFFER_BYTE_LIMIT_KEY + "(= " +
appenderBufferSize + ").");
}
final RaftProperties properties = raftServer.getProperties();