Skip to content

Commit

Permalink
[CELEBORN-1525] Bump Ratis version from 3.1.0 to 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SteNicholas committed Sep 26, 2024
1 parent 5c32ba7 commit 059f9fa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 35 deletions.
20 changes: 10 additions & 10 deletions dev/deps/dependencies-server
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar
paranamer/2.8//paranamer-2.8.jar
picocli/4.7.6//picocli-4.7.6.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/3.1.0//ratis-client-3.1.0.jar
ratis-common/3.1.0//ratis-common-3.1.0.jar
ratis-grpc/3.1.0//ratis-grpc-3.1.0.jar
ratis-metrics-api/3.1.0//ratis-metrics-api-3.1.0.jar
ratis-metrics-default/3.1.0//ratis-metrics-default-3.1.0.jar
ratis-netty/3.1.0//ratis-netty-3.1.0.jar
ratis-proto/3.1.0//ratis-proto-3.1.0.jar
ratis-server-api/3.1.0//ratis-server-api-3.1.0.jar
ratis-server/3.1.0//ratis-server-3.1.0.jar
ratis-shell/3.1.0//ratis-shell-3.1.0.jar
ratis-client/3.1.1//ratis-client-3.1.1.jar
ratis-common/3.1.1//ratis-common-3.1.1.jar
ratis-grpc/3.1.1//ratis-grpc-3.1.1.jar
ratis-metrics-api/3.1.1//ratis-metrics-api-3.1.1.jar
ratis-metrics-default/3.1.1//ratis-metrics-default-3.1.1.jar
ratis-netty/3.1.1//ratis-netty-3.1.1.jar
ratis-proto/3.1.1//ratis-proto-3.1.1.jar
ratis-server-api/3.1.1//ratis-server-api-3.1.1.jar
ratis-server/3.1.1//ratis-server-3.1.1.jar
ratis-shell/3.1.1//ratis-shell-3.1.1.jar
ratis-thirdparty-misc/1.0.6//ratis-thirdparty-misc-1.0.6.jar
rocksdbjni/9.5.2//rocksdbjni-9.5.2.jar
scala-library/2.12.18//scala-library-2.12.18.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.io.File;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
Expand All @@ -35,7 +34,6 @@
import scala.Tuple2;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.net.InetAddresses;
import com.google.protobuf.InvalidProtocolBufferException;
import org.apache.ratis.RaftConfigKeys;
import org.apache.ratis.client.RaftClientConfigKeys;
Expand Down Expand Up @@ -174,22 +172,6 @@ private HARaftServer(
TimeUnit.MILLISECONDS);
}

// copy of org.apache.ratis.util.NetUtils.address2String
private static String address2String(InetSocketAddress address) {
if (address == null) {
return null;
}
String hostName = address.getHostName();
final StringBuilder b = new StringBuilder(hostName);
// Surround with '[', ']' only if it is a IPv6 ip - not for a IPv6 host
if (address.getAddress() instanceof Inet6Address
&& InetAddresses.isInetAddress(hostName)
&& InetAddresses.forString(hostName).getAddress().length == 16) {
b.insert(0, '[').append(']');
}
return b.append(':').append(address.getPort()).toString();
}

public static HARaftServer newMasterRatisServer(
MetaHandler metaHandler, CelebornConf conf, MasterNode localNode, List<MasterNode> peerNodes)
throws IOException {
Expand All @@ -200,9 +182,7 @@ public static HARaftServer newMasterRatisServer(
RaftPeer localRaftPeer =
RaftPeer.newBuilder()
.setId(localRaftPeerId)
// TODO(CELEBORN-1525): Once Ratis 3.2.0 is released and we move to it, we
// should remove address2String and change this to .setAddress(ratisAddr)
.setAddress(address2String(ratisAddr))
.setAddress(ratisAddr)
.setClientAddress(localNode.rpcEndpoint())
// We use admin address to host the internal rpc address
.setAdminAddress(localNode.internalRpcEndpoint())
Expand All @@ -229,7 +209,7 @@ public static HARaftServer newMasterRatisServer(
raftPeer =
RaftPeer.newBuilder()
.setId(raftPeerId)
.setAddress(address2String(peerRatisAddr))
.setAddress(peerRatisAddr)
.setClientAddress(peer.rpcEndpoint())
// We use admin address to host the internal rpc address
.setAdminAddress(peer.internalRpcEndpoint())
Expand Down Expand Up @@ -359,7 +339,10 @@ private RaftProperties newRaftProperties(CelebornConf conf, RpcType rpc) {
RaftServerConfigKeys.Log.setPurgeGap(properties, logPurgeGap);

// For grpc set the maximum message size
GrpcConfigKeys.setMessageSizeMax(properties, SizeInBytes.valueOf(logAppenderQueueByteLimit));
// RATIS-2135. The leader keeps sending inconsistent entries repeatedly to followers.
// raft.grpc.message.size.max must be 1m larger than raft.server.log.appender.buffer.byte-limit
GrpcConfigKeys.setMessageSizeMax(
properties, SizeInBytes.valueOf(logAppenderQueueByteLimit + SizeInBytes.ONE_MB.getSize()));

// Set the server request timeout
TimeDuration serverRequestTimeout =
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<netty.version>4.1.109.Final</netty.version>
<bouncycastle.version>1.77</bouncycastle.version>
<protobuf.version>3.21.7</protobuf.version>
<ratis.version>3.1.0</ratis.version>
<ratis.version>3.1.1</ratis.version>
<scalatest.version>3.2.16</scalatest.version>
<slf4j.version>1.7.36</slf4j.version>
<roaringbitmap.version>1.0.6</roaringbitmap.version>
Expand Down
2 changes: 1 addition & 1 deletion project/CelebornBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object Dependencies {
val metricsVersion = "4.2.25"
val mockitoVersion = "4.11.0"
val nettyVersion = "4.1.109.Final"
val ratisVersion = "3.1.0"
val ratisVersion = "3.1.1"
val roaringBitmapVersion = "1.0.6"
val rocksdbJniVersion = "9.5.2"
val jacksonVersion = "2.15.3"
Expand Down

0 comments on commit 059f9fa

Please sign in to comment.