Skip to content

Commit

Permalink
[CELEBORN-1400] Bump Ratis version from 2.5.1 to 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SteNicholas committed May 29, 2024
1 parent 043a20e commit 39523e4
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,10 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se

def haMasterRatisRpcType: String = get(HA_MASTER_RATIS_RPC_TYPE)
def haMasterRatisStorageDir: String = get(HA_MASTER_RATIS_STORAGE_DIR)
def haMasterRatisStorageStartupOption: String = get(HA_MASTER_RATIS_STORAGE_STARTUP_OPTION)
def haMasterRatisLogSegmentSizeMax: Long = get(HA_MASTER_RATIS_LOG_SEGMENT_SIZE_MAX)
def haMasterRatisLogPreallocatedSize: Long = get(HA_MASTER_RATIS_LOG_PREALLOCATED_SIZE)
def haMasterRatisLogWriteBufferSize: Long = get(HA_MASTER_RATIS_LOG_WRITE_BUFFER_SIZE)
def haMasterRatisLogAppenderQueueNumElements: Int =
get(HA_MASTER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS)
def haMasterRatisLogAppenderQueueBytesLimit: Long =
Expand Down Expand Up @@ -2265,10 +2267,20 @@ object CelebornConf extends Logging {
buildConf("celeborn.master.ha.ratis.raft.server.storage.dir")
.withAlternative("celeborn.ha.master.ratis.raft.server.storage.dir")
.categories("ha")
.doc("Root storage directory to hold RaftServer data.")
.version("0.3.0")
.stringConf
.createWithDefault("/tmp/ratis")

val HA_MASTER_RATIS_STORAGE_STARTUP_OPTION: ConfigEntry[String] =
buildConf("celeborn.master.ha.ratis.raft.server.storage.startup.option")
.categories("ha")
.doc("Startup option of RaftServer storage. Available options: RECOVER, FORMAT.")
.version("0.5.0")
.stringConf
.checkValues(Set("RECOVER", "FORMAT"))
.createWithDefault("RECOVER")

val HA_MASTER_RATIS_LOG_SEGMENT_SIZE_MAX: ConfigEntry[Long] =
buildConf("celeborn.master.ha.ratis.raft.server.log.segment.size.max")
.withAlternative("celeborn.ha.master.ratis.raft.server.log.segment.size.max")
Expand All @@ -2287,6 +2299,14 @@ object CelebornConf extends Logging {
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("4MB")

val HA_MASTER_RATIS_LOG_WRITE_BUFFER_SIZE: ConfigEntry[Long] =
buildConf("celeborn.master.ha.ratis.raft.server.log.write.buffer.size")
.internal
.categories("ha")
.version("0.5.0")
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("36MB")

val HA_MASTER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS: ConfigEntry[Int] =
buildConf("celeborn.master.ha.ratis.raft.server.log.appender.buffer.element-limit")
.withAlternative("celeborn.ha.master.ratis.raft.server.log.appender.buffer.element-limit")
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-flink-1.14
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-flink-1.15
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-flink-1.17
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-flink-1.18
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-flink-1.19
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-mr
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ okhttp/4.9.3//okhttp-4.9.3.jar
okio/2.8.0//okio-2.8.0.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
re2j/1.1//re2j-1.1.jar
reload4j/1.2.22//reload4j-1.2.22.jar
scala-library/2.12.18//scala-library-2.12.18.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-2.4
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.11.12//scala-library-2.11.12.jar
scala-reflect/2.11.12//scala-reflect-2.11.12.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.0
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.10//scala-library-2.12.10.jar
scala-reflect/2.12.10//scala-reflect-2.12.10.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.1
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.10//scala-library-2.12.10.jar
scala-reflect/2.12.10//scala-reflect-2.12.10.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.2
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.15//scala-library-2.12.15.jar
scala-reflect/2.12.15//scala-reflect-2.12.15.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.3
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.15//scala-library-2.12.15.jar
scala-reflect/2.12.15//scala-reflect-2.12.15.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.4
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.17//scala-library-2.12.17.jar
scala-reflect/2.12.17//scala-reflect-2.12.17.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
8 changes: 4 additions & 4 deletions dev/deps/dependencies-client-spark-3.5
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ netty-transport-udt/4.1.109.Final//netty-transport-udt-4.1.109.Final.jar
netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
scala-library/2.12.18//scala-library-2.12.18.jar
scala-reflect/2.12.18//scala-reflect-2.12.18.jar
slf4j-api/1.7.36//slf4j-api-1.7.36.jar
Expand Down
20 changes: 10 additions & 10 deletions dev/deps/dependencies-server
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ netty-transport/4.1.109.Final//netty-transport-4.1.109.Final.jar
osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar
paranamer/2.8//paranamer-2.8.jar
protobuf-java/3.21.7//protobuf-java-3.21.7.jar
ratis-client/2.5.1//ratis-client-2.5.1.jar
ratis-common/2.5.1//ratis-common-2.5.1.jar
ratis-grpc/2.5.1//ratis-grpc-2.5.1.jar
ratis-metrics/2.5.1//ratis-metrics-2.5.1.jar
ratis-netty/2.5.1//ratis-netty-2.5.1.jar
ratis-proto/2.5.1//ratis-proto-2.5.1.jar
ratis-server-api/2.5.1//ratis-server-api-2.5.1.jar
ratis-server/2.5.1//ratis-server-2.5.1.jar
ratis-shell/2.5.1//ratis-shell-2.5.1.jar
ratis-thirdparty-misc/1.0.4//ratis-thirdparty-misc-1.0.4.jar
ratis-client/3.0.1//ratis-client-3.0.1.jar
ratis-common/3.0.1//ratis-common-3.0.1.jar
ratis-grpc/3.0.1//ratis-grpc-3.0.1.jar
ratis-metrics-default/3.0.1/ratis-metrics-default-3.0.1.jar
ratis-netty/3.0.1//ratis-netty-3.0.1.jar
ratis-proto/3.0.1//ratis-proto-3.0.1.jar
ratis-server-api/3.0.1//ratis-server-api-3.0.1.jar
ratis-server/3.0.1//ratis-server-3.0.1.jar
ratis-shell/3.0.1//ratis-shell-3.0.1.jar
ratis-thirdparty-misc/1.0.5//ratis-thirdparty-misc-1.0.5.jar
reflections/0.10.2//reflections-0.10.2.jar
rocksdbjni/8.11.3//rocksdbjni-8.11.3.jar
scala-library/2.12.18//scala-library-2.12.18.jar
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration/ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ license: |
| celeborn.master.ha.node.&lt;id&gt;.port | 9097 | false | Port to bind of master node <id> in HA mode. | 0.3.0 | celeborn.ha.master.node.&lt;id&gt;.port |
| celeborn.master.ha.node.&lt;id&gt;.ratis.port | 9872 | false | Ratis port to bind of master node <id> in HA mode. | 0.3.0 | celeborn.ha.master.node.&lt;id&gt;.ratis.port |
| celeborn.master.ha.ratis.raft.rpc.type | netty | false | RPC type for Ratis, available options: netty, grpc. | 0.3.0 | celeborn.ha.master.ratis.raft.rpc.type |
| celeborn.master.ha.ratis.raft.server.storage.dir | /tmp/ratis | false | | 0.3.0 | celeborn.ha.master.ratis.raft.server.storage.dir |
| celeborn.master.ha.ratis.raft.server.storage.dir | /tmp/ratis | false | Root storage directory to hold RaftServer data. | 0.3.0 | celeborn.ha.master.ratis.raft.server.storage.dir |
| celeborn.master.ha.ratis.raft.server.storage.startup.option | RECOVER | false | Startup option of RaftServer storage. Available options: RECOVER, FORMAT. | 0.5.0 | |
<!--end-include-->
4 changes: 4 additions & 0 deletions master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-shell</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-metrics-default</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.ratis.rpc.SupportedRpcType;
import org.apache.ratis.server.RaftServer;
import org.apache.ratis.server.RaftServerConfigKeys;
import org.apache.ratis.server.storage.RaftStorage.StartupOption;
import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
import org.apache.ratis.util.LifeCycle;
import org.apache.ratis.util.SizeInBytes;
Expand Down Expand Up @@ -144,6 +145,8 @@ private HARaftServer(
.setProperties(serverProperties)
.setParameters(sslParameters)
.setStateMachine(masterStateMachine)
// RATIS-1677. Do not auto format RaftStorage in RECOVER.
.setOption(StartupOption.valueOf(conf.haMasterRatisStorageStartupOption()))
.build();

StringBuilder raftPeersStr = new StringBuilder();
Expand Down Expand Up @@ -306,15 +309,31 @@ private RaftProperties newRaftProperties(CelebornConf conf, RpcType rpc) {

// Set RAFT segment pre-allocated size
long raftSegmentPreallocatedSize = conf.haMasterRatisLogPreallocatedSize();
long raftSegmentWriteBufferSize = conf.haMasterRatisLogWriteBufferSize();
int logAppenderQueueNumElements = conf.haMasterRatisLogAppenderQueueNumElements();
long logAppenderQueueByteLimit = conf.haMasterRatisLogAppenderQueueBytesLimit();
// RATIS-589. Eliminate buffer copying in SegmentedRaftLogOutputStream.
// 4 bytes (serialized size) + logAppenderQueueByteLimit + 4 bytes (checksum)
if (raftSegmentWriteBufferSize < logAppenderQueueByteLimit + 8) {
throw new IllegalArgumentException(
RaftServerConfigKeys.Log.WRITE_BUFFER_SIZE_KEY
+ " (= "
+ raftSegmentWriteBufferSize
+ ") is less than "
+ RaftServerConfigKeys.Log.Appender.BUFFER_BYTE_LIMIT_KEY
+ " + 8 (= "
+ (logAppenderQueueByteLimit + 8)
+ ")");
}
boolean shouldInstallSnapshot = conf.haMasterRatisLogInstallSnapshotEnabled();
RaftServerConfigKeys.Log.Appender.setBufferElementLimit(
properties, logAppenderQueueNumElements);
RaftServerConfigKeys.Log.Appender.setBufferByteLimit(
properties, SizeInBytes.valueOf(logAppenderQueueByteLimit));
RaftServerConfigKeys.Log.setPreallocatedSize(
properties, SizeInBytes.valueOf(raftSegmentPreallocatedSize));
RaftServerConfigKeys.Log.setWriteBufferSize(
properties, SizeInBytes.valueOf(raftSegmentWriteBufferSize));
RaftServerConfigKeys.Log.Appender.setInstallSnapshotEnabled(properties, shouldInstallSnapshot);
int logPurgeGap = conf.haMasterRatisLogPurgeGap();
RaftServerConfigKeys.Log.setPurgeGap(properties, logPurgeGap);
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<netty.version>4.1.109.Final</netty.version>
<bouncycastle.version>1.77</bouncycastle.version>
<protobuf.version>3.21.7</protobuf.version>
<ratis.version>2.5.1</ratis.version>
<ratis.version>3.0.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 Expand Up @@ -283,6 +283,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-metrics-default</artifactId>
<version>${ratis.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion project/CelebornBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object Dependencies {
val metricsVersion = "3.2.6"
val mockitoVersion = "4.11.0"
val nettyVersion = "4.1.109.Final"
val ratisVersion = "2.5.1"
val ratisVersion = "3.0.1"
val roaringBitmapVersion = "1.0.6"
val rocksdbJniVersion = "8.11.3"
val jacksonVersion = "2.15.3"
Expand Down Expand Up @@ -127,6 +127,7 @@ object Dependencies {
val ratisClient = "org.apache.ratis" % "ratis-client" % ratisVersion
val ratisCommon = "org.apache.ratis" % "ratis-common" % ratisVersion
val ratisGrpc = "org.apache.ratis" % "ratis-grpc" % ratisVersion
val ratisMetricsDefault = "org.apache.ratis" % "ratis-metrics-default" % ratisVersion
val ratisNetty = "org.apache.ratis" % "ratis-netty" % ratisVersion
val ratisServer = "org.apache.ratis" % "ratis-server" % ratisVersion
val ratisShell = "org.apache.ratis" % "ratis-shell" % ratisVersion excludeAll(
Expand Down Expand Up @@ -551,6 +552,7 @@ object CelebornMaster {
Dependencies.ratisClient,
Dependencies.ratisCommon,
Dependencies.ratisGrpc,
Dependencies.ratisMetricsDefault,
Dependencies.ratisNetty,
Dependencies.ratisServer,
Dependencies.ratisShell
Expand Down

0 comments on commit 39523e4

Please sign in to comment.