From 561121c559b1c6bdd20db09f01dd6c526c365437 Mon Sep 17 00:00:00 2001 From: Yongqiang YANG Date: Tue, 13 Aug 2024 19:46:29 +0800 Subject: [PATCH] [enhancement](meta) make checkpoint_interval_seconds configable for test --- .../src/main/java/org/apache/doris/common/Config.java | 7 +++++++ .../src/main/java/org/apache/doris/common/FeConstants.java | 2 -- .../src/main/java/org/apache/doris/master/Checkpoint.java | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 8dcc2bbef95aff..ecde5a916d4a52 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2703,6 +2703,13 @@ public class Config extends ConfigBase { @ConfField public static boolean checkpoint_after_check_compatibility = false; + // Advance the next id before transferring to the master. + @ConfField(description = { + "对 meta 做 checkpoint 时的时间间隔,单位为秒", + "The interval of checkpointing meta, in seconds" + }) + public static int checkpoint_interval_seconds = 60; + // Advance the next id before transferring to the master. @ConfField(description = { "是否在成为 Master 后推进 ID 分配器,保证即使回滚元数据时,它也不会回滚", diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java b/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java index 1c24ca69d4f191..2efd46e4ad851c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java @@ -34,8 +34,6 @@ public class FeConstants { public static int shortkey_max_column_count = 3; public static int shortkey_maxsize_bytes = 36; - public static int checkpoint_interval_second = 60; // 1 minutes - // dpp version public static String dpp_version = "3_2_0"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java b/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java index 27dc6aa7b8700e..5d8c53b46c70d1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java +++ b/fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java @@ -20,7 +20,6 @@ import org.apache.doris.catalog.Env; import org.apache.doris.common.CheckpointException; import org.apache.doris.common.Config; -import org.apache.doris.common.FeConstants; import org.apache.doris.common.util.HttpURLUtil; import org.apache.doris.common.util.MasterDaemon; import org.apache.doris.common.util.NetUtils; @@ -61,7 +60,7 @@ public class Checkpoint extends MasterDaemon { private int memoryNotEnoughCount = 0; public Checkpoint(EditLog editLog) { - super("leaderCheckpointer", FeConstants.checkpoint_interval_second * 1000L); + super("leaderCheckpointer", Config.checkpoint_interval_seconds * 1000L); this.imageDir = Env.getServingEnv().getImageDir(); this.editLog = editLog; }