From fb046b93b3a05470547d038571e16085a98ff525 Mon Sep 17 00:00:00 2001 From: deardeng Date: Fri, 22 Aug 2025 21:55:19 +0800 Subject: [PATCH] =?UTF-8?q?[opt][editlog]=20Added=20the=20ability=20to=20s?= =?UTF-8?q?kip=20certain=20editlog=20exceptions=20w=E2=80=A6=20(#54090)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …hen fe is abnormal The previous operation and maintenance method force_skip_journal_ids can only skip a specific logid. If there are many abnormal logids, it is difficult to configure --- .../java/org/apache/doris/common/Config.java | 9 ++++++++- .../java/org/apache/doris/persist/EditLog.java | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 3 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 1a33cc1d72f3f3..c09f3f315103a3 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 @@ -1325,6 +1325,13 @@ public class Config extends ConfigBase { @ConfField(mutable = false, masterOnly = false) public static String[] force_skip_journal_ids = {}; + @ConfField(description = {"当回放 editlog 时遇到特定操作类型的异常导致 FE 无法启动时,可以配置需要忽略的 editlog 操作类型枚举值," + + "从而跳过这些异常,让 replay 线程可以继续回放其他日志", + "When replaying editlog encounters exceptions with specific operation types that prevent FE from starting, " + + "you can configure the editlog operation type enum values to be ignored, " + + "thereby skipping these exceptions and allowing the replay thread to continue replaying other logs"}) + public static short[] skip_operation_types_on_replay_exception = {-1, -1}; + /** * Decide how often to check dynamic partition */ @@ -2416,7 +2423,7 @@ public class Config extends ConfigBase { /** * To prevent different types (V1, V2, V3) of behavioral inconsistencies, * we may delete the DecimalV2 and DateV1 types in the future. - * At this stage, we use ‘disable_decimalv2’ and ‘disable_datev1’ + * At this stage, we use 'disable_decimalv2' and 'disable_datev1' * to determine whether these two types take effect. */ @ConfField(mutable = true) diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java b/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java index a06e2c4b693a67..81280575248cc1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java +++ b/fe/fe-core/src/main/java/org/apache/doris/persist/EditLog.java @@ -1274,8 +1274,20 @@ public static void loadJournal(Env env, Long logId, JournalEntity journal) { */ LOG.warn("[INCONSISTENT META] replay log {} failed, journal {}: {}", logId, journal, e.getMessage(), e); } catch (Exception e) { - LOG.error("replay Operation Type {}, log id: {}", opCode, logId, e); - System.exit(-1); + short[] ignoreExceptionLogIds = Config.skip_operation_types_on_replay_exception; + boolean skip = false; + for (short ignoreLogId : ignoreExceptionLogIds) { + if (ignoreLogId == opCode) { + skip = true; + break; + } + } + if (!skip) { + LOG.error("replay Operation Type {}, log id: {}", opCode, logId, e); + System.exit(-1); + } else { + LOG.warn("Skip replay Operation Type {} due to exception, log id: {}", opCode, logId, e); + } } }