This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 5c5cf37a65d [chore](fe) Add some important information in fe log for debug (#34352) 5c5cf37a65d is described below commit 5c5cf37a65d3f83dfccf913d212ae543aaeeaaf7 Author: Lei Zhang <27994433+swjtu-zhang...@users.noreply.github.com> AuthorDate: Mon May 6 19:52:30 2024 +0800 [chore](fe) Add some important information in fe log for debug (#34352) * Add git commit info in fe.log/fe.out when fe start * Add `metadata recovery mode` log in fe.log/fe.out * Add bdb journal info in fe.log when size over `1M` --- .../src/main/java/org/apache/doris/DorisFE.java | 39 ++++++++++++---------- .../apache/doris/journal/bdbje/BDBEnvironment.java | 5 +-- .../apache/doris/journal/bdbje/BDBJEJournal.java | 4 +-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java index 696634fed34..816106edf9b 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java +++ b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java @@ -101,29 +101,13 @@ public class DorisFE { CommandLineOptions cmdLineOpts = parseArgs(args); try { - if (cmdLineOpts.isVersion()) { - printVersion(); - System.exit(0); - } - - // pid file - if (!createAndLockPidFile(pidDir + "/fe.pid")) { - throw new IOException("pid file is already locked."); - } - // init config Config config = new Config(); config.init(dorisHomeDir + "/conf/fe.conf"); // Must init custom config after init config, separately. // Because the path of custom config file is defined in fe.conf config.initCustom(Config.custom_config_dir + "/fe_custom.conf"); - LOCK_FILE_PATH = Config.meta_dir + "/" + LOCK_FILE_NAME; - try { - tryLockProcess(); - } catch (Exception e) { - LOG.error("start doris failed.", e); - System.exit(-1); - } + LdapConfig ldapConfig = new LdapConfig(); if (new File(dorisHomeDir + "/conf/ldap.conf").exists()) { ldapConfig.init(dorisHomeDir + "/conf/ldap.conf"); @@ -142,9 +126,21 @@ public class DorisFE { // set dns cache ttl java.security.Security.setProperty("networkaddress.cache.ttl", "60"); + // pid file + if (!cmdLineOpts.isVersion() && !createAndLockPidFile(pidDir + "/fe.pid")) { + throw new IOException("pid file is already locked."); + } + // check command line options checkCommandLineOptions(cmdLineOpts); + try { + tryLockProcess(); + } catch (Exception e) { + LOG.error("start doris failed.", e); + System.exit(-1); + } + LOG.info("Doris FE starting..."); FrontendOptions.init(); @@ -384,6 +380,12 @@ public class DorisFE { System.out.println("Build info: " + Version.DORIS_BUILD_INFO); System.out.println("Build hash: " + Version.DORIS_BUILD_HASH); System.out.println("Java compile version: " + Version.DORIS_JAVA_COMPILE_VERSION); + + LOG.info("Build version: {}", Version.DORIS_BUILD_VERSION); + LOG.info("Build time: {}", Version.DORIS_BUILD_TIME); + LOG.info("Build info: {}", Version.DORIS_BUILD_INFO); + LOG.info("Build hash: {}", Version.DORIS_BUILD_HASH); + LOG.info("Java compile version: {}", Version.DORIS_JAVA_COMPILE_VERSION); } private static void checkCommandLineOptions(CommandLineOptions cmdLineOpts) { @@ -416,7 +418,7 @@ public class DorisFE { } } } - + printVersion(); // go on } @@ -450,6 +452,7 @@ public class DorisFE { */ private static void tryLockProcess() { try { + LOCK_FILE_PATH = Config.meta_dir + "/" + LOCK_FILE_NAME; processLockFileChannel = FileChannel.open(new File(LOCK_FILE_PATH).toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE); processFileLock = processLockFileChannel.tryLock(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java index f80f5e7dd20..47a41b8226a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java @@ -101,11 +101,12 @@ public class BDBEnvironment { LOG.error("Current node is not in the electable_nodes list. will exit"); System.exit(-1); } - LOG.info("start group reset"); + LOG.warn("start group reset"); DbResetRepGroup resetUtility = new DbResetRepGroup( envHome, PALO_JOURNAL_GROUP, selfNodeName, selfNodeHostPort); resetUtility.reset(); - LOG.info("group has been reset."); + LOG.warn("WARNING: metadata recovery mode, group has been reset."); + System.out.println("WARNING: metadata recovery mode, group has been reset."); } // set replication config diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java index 4fec54786d2..0d342a986cd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java @@ -242,8 +242,8 @@ public class BDBJEJournal implements Journal { // CHECKSTYLE IGNORE THIS LINE: B MetricRepo.COUNTER_EDIT_LOG_SIZE_BYTES.increase((long) theData.getSize()); MetricRepo.COUNTER_CURRENT_EDIT_LOG_SIZE_BYTES.increase((long) theData.getSize()); } - if (LOG.isDebugEnabled()) { - LOG.debug("opCode = {}, journal size = {}", op, theData.getSize()); + if (LOG.isDebugEnabled() || theData.getSize() > (1 << 20)) { + LOG.info("opCode = {}, journal size = {}", op, theData.getSize()); } // Write the key value pair to bdb. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org