This is an automated email from the ASF dual-hosted git repository.
ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new ac78afdc4 [CELEBORN-594] Eliminate Ratis noisy logs. (#1499)
ac78afdc4 is described below
commit ac78afdc4e9f89bbbec28a58b5f8c7924c7e00b3
Author: Ethan Feng <[email protected]>
AuthorDate: Fri May 19 14:05:52 2023 +0800
[CELEBORN-594] Eliminate Ratis noisy logs. (#1499)
---
.../org/apache/celeborn/common/CelebornConf.scala | 18 ++++++++++++++++++
conf/log4j2.xml.template | 4 ++++
.../deploy/master/clustermeta/ha/HARaftServer.java | 7 +++++++
3 files changed, 29 insertions(+)
diff --git
a/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
b/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
index 75d7038b6..ae50b109a 100644
--- a/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
@@ -622,6 +622,8 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable
with Logging with Se
def haMasterRatisRetryCacheExpiryTime: Long =
get(HA_MASTER_RATIS_SERVER_RETRY_CACHE_EXPIRY_TIME)
def haMasterRatisRpcTimeoutMin: Long = get(HA_MASTER_RATIS_RPC_TIMEOUT_MIN)
def haMasterRatisRpcTimeoutMax: Long = get(HA_MASTER_RATIS_RPC_TIMEOUT_MAX)
+ def haMasterRatisFirstElectionTimeoutMin: Long =
get(HA_MASTER_RATIS_FIRSTELECTION_TIMEOUT_MIN)
+ def haMasterRatisFristElectionTimeoutMax: Long =
get(HA_MASTER_RATIS_FIRSTELECTION_TIMEOUT_MAX)
def haMasterRatisNotificationNoLeaderTimeout: Long =
get(HA_MASTER_RATIS_NOTIFICATION_NO_LEADER_TIMEOUT)
def haMasterRatisRpcSlownessTimeout: Long =
get(HA_MASTER_RATIS_RPC_SLOWNESS_TIMEOUT)
@@ -1735,6 +1737,22 @@ object CelebornConf extends Logging {
.timeConf(TimeUnit.SECONDS)
.createWithDefaultString("5s")
+ val HA_MASTER_RATIS_FIRSTELECTION_TIMEOUT_MIN: ConfigEntry[Long] =
+ buildConf("celeborn.ha.master.ratis.first.election.timeout.min")
+ .internal
+ .categories("master")
+ .version("0.3.0")
+ .timeConf(TimeUnit.SECONDS)
+ .createWithDefaultString("3s")
+
+ val HA_MASTER_RATIS_FIRSTELECTION_TIMEOUT_MAX: ConfigEntry[Long] =
+ buildConf("celeborn.ha.master.ratis.first.election.timeout.max")
+ .internal
+ .categories("master")
+ .version("0.3.0")
+ .timeConf(TimeUnit.SECONDS)
+ .createWithDefaultString("5s")
+
val HA_MASTER_RATIS_NOTIFICATION_NO_LEADER_TIMEOUT: ConfigEntry[Long] =
buildConf("celeborn.ha.master.ratis.raft.server.notification.no-leader.timeout")
.internal
diff --git a/conf/log4j2.xml.template b/conf/log4j2.xml.template
index b2fdf4ef0..a7dee77c8 100644
--- a/conf/log4j2.xml.template
+++ b/conf/log4j2.xml.template
@@ -53,5 +53,9 @@
<Appender-ref ref="stdout" level="WARN" />
<Appender-ref ref="file" level="WARN"/>
</Logger>
+ <Logger name="org.apache.ratis.server.RaftServerConfigKeys"
level="WARN" additivity="false">
+ <Appender-ref ref="stdout" level="WARN" />
+ <Appender-ref ref="file" level="WARN"/>
+ </Logger>
</Loggers>
</Configuration>
diff --git
a/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/HARaftServer.java
b/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/HARaftServer.java
index af9d549af..612a09a43 100644
---
a/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/HARaftServer.java
+++
b/master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/HARaftServer.java
@@ -347,6 +347,13 @@ public class HARaftServer {
RaftServerConfigKeys.Rpc.setTimeoutMin(properties, rpcTimeoutMin);
RaftServerConfigKeys.Rpc.setTimeoutMax(properties, rpcTimeoutMax);
+ TimeDuration firstElectionTimeoutMin =
+ TimeDuration.valueOf(conf.haMasterRatisFirstElectionTimeoutMin(),
TimeUnit.SECONDS);
+ TimeDuration firstElectionTimeoutMax =
+ TimeDuration.valueOf(conf.haMasterRatisFristElectionTimeoutMax(),
TimeUnit.SECONDS);
+ RaftServerConfigKeys.Rpc.setFirstElectionTimeoutMin(properties,
firstElectionTimeoutMin);
+ RaftServerConfigKeys.Rpc.setFirstElectionTimeoutMax(properties,
firstElectionTimeoutMax);
+
// Set the number of maximum cached segments
RaftServerConfigKeys.Log.setSegmentCacheNumMax(properties, 2);