This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 47a865b602c [chore](fe) Add some important information in fe log for
debug (#34352) (#37627)
47a865b602c is described below
commit 47a865b602c26a5f26e115cf1d3a6ce51035f81f
Author: Lei Zhang <[email protected]>
AuthorDate: Thu Jul 11 09:40:38 2024 +0800
[chore](fe) Add some important information in fe log for debug (#34352)
(#37627)
* 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`
## Proposed changes
Issue Number: close #xxx
<!--Describe your changes.-->
---
.../src/main/java/org/apache/doris/DorisFE.java | 42 +++++++++++++++-------
.../apache/doris/journal/bdbje/BDBEnvironment.java | 5 +--
.../apache/doris/journal/bdbje/BDBJEJournal.java | 4 +--
3 files changed, 34 insertions(+), 17 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 d757ec1711d..0ca080f6fd4 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
@@ -102,24 +102,13 @@ public class DorisFE {
CommandLineOptions cmdLineOpts = parseArgs(args);
try {
- // 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");
@@ -136,9 +125,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();
@@ -368,6 +369,20 @@ public class DorisFE {
return new CommandLineOptions(false, null, null, "");
}
+ private static void printVersion() {
+ System.out.println("Build version: " + Version.DORIS_BUILD_VERSION);
+ System.out.println("Build time: " + Version.DORIS_BUILD_TIME);
+ 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) {
if (cmdLineOpts.isVersion()) {
System.out.println("Build version: " +
Version.DORIS_BUILD_VERSION);
@@ -402,7 +417,7 @@ public class DorisFE {
}
}
}
-
+ printVersion();
// go on
}
@@ -438,6 +453,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 09eb03b1577..11a57a61050 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
@@ -100,11 +100,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 3746e769f34..85e577058be 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
@@ -145,8 +145,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: [email protected]
For additional commands, e-mail: [email protected]