You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2019/11/08 00:48:19 UTC

[incubator-doris] branch master updated: Ignore --helper start argument if not first time to start FE (#2159)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new af79485  Ignore --helper start argument if not first time to start FE (#2159)
af79485 is described below

commit af79485eb2f9201fc76d715b15d4941cecfb4591
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Fri Nov 8 08:48:11 2019 +0800

    Ignore --helper start argument if not first time to start FE (#2159)
---
 fe/src/main/java/org/apache/doris/catalog/Catalog.java      | 13 +++++++++----
 fe/src/main/java/org/apache/doris/master/Checkpoint.java    |  7 +++++++
 .../test/java/org/apache/doris/alter/RollupJobV2Test.java   |  1 +
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/fe/src/main/java/org/apache/doris/catalog/Catalog.java b/fe/src/main/java/org/apache/doris/catalog/Catalog.java
index df5abde..5f55be4 100644
--- a/fe/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -687,10 +687,15 @@ public class Catalog {
         File roleFile = new File(IMAGE_DIR, Storage.ROLE_FILE);
         File versionFile = new File(IMAGE_DIR, Storage.VERSION_FILE);
 
-        // helper node is the local node. This usually happens when the very
-        // first node to start,
-        // or when one node to restart.
-        if (isMyself()) {
+        // if helper node is point to self, or there is ROLE and VERSION file in local.
+        // get the node type from local
+        if (isMyself() || (roleFile.exists() && versionFile.exists())) {
+
+            if (!isMyself()) {
+                LOG.info("find ROLE and VERSION file in local, ignore helper nodes: {}", helperNodes);
+            }
+
+            // check file integrity, if has.
             if ((roleFile.exists() && !versionFile.exists())
                     || (!roleFile.exists() && versionFile.exists())) {
                 LOG.error("role file and version file must both exist or both not exist. "
diff --git a/fe/src/main/java/org/apache/doris/master/Checkpoint.java b/fe/src/main/java/org/apache/doris/master/Checkpoint.java
index f87660d..6802a86 100644
--- a/fe/src/main/java/org/apache/doris/master/Checkpoint.java
+++ b/fe/src/main/java/org/apache/doris/master/Checkpoint.java
@@ -69,6 +69,13 @@ public class Checkpoint extends Daemon {
 
     @Override
     protected void runOneCycle() {
+        if (!Catalog.getInstance().isReady()) {
+            // here we use getInstance(), not getCurrentCatalog() because we truly want the Catalog instance,
+            // not the Checkpoint catalog instance.
+            // and if catalog is not ready, do not doing checkpoint.
+            return;
+        }
+
         long imageVersion = 0;
         long checkPointVersion = 0;
         Storage storage = null;
diff --git a/fe/src/test/java/org/apache/doris/alter/RollupJobV2Test.java b/fe/src/test/java/org/apache/doris/alter/RollupJobV2Test.java
index e8373d5..2849e4f 100644
--- a/fe/src/test/java/org/apache/doris/alter/RollupJobV2Test.java
+++ b/fe/src/test/java/org/apache/doris/alter/RollupJobV2Test.java
@@ -94,6 +94,7 @@ public class RollupJobV2Test {
         clause.analyze(analyzer);
 
         FeConstants.runningUnitTest = true;
+        AgentTaskQueue.clearAllTasks();
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org