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

caogaofei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 415808dc2e Add cluster_name related judgement and logs (#8727)
415808dc2e is described below

commit 415808dc2e60bb3b21185d46b6f41844c12d2cd7
Author: YongzaoDan <[email protected]>
AuthorDate: Wed Jan 4 15:00:43 2023 +0800

    Add cluster_name related judgement and logs (#8727)
---
 .../main/antlr4/org/apache/iotdb/db/qp/sql/IdentifierParser.g4 |  1 -
 .../apache/iotdb/confignode/conf/SystemPropertiesUtils.java    |  5 +++++
 .../java/org/apache/iotdb/confignode/service/ConfigNode.java   | 10 ++--------
 .../iotdb/db/mpp/common/header/ColumnHeaderConstant.java       |  4 ++--
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git 
a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IdentifierParser.g4 
b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IdentifierParser.g4
index 656db62d01..b15b5d5b6f 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IdentifierParser.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IdentifierParser.g4
@@ -198,5 +198,4 @@ keyWords
     | WITHOUT
     | WRITABLE
     | PRIVILEGE_VALUE
-    | PARAMETERS
     ;
\ No newline at end of file
diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
 
b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
index 4ee1f1ccea..a5aa7e7dfc 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
@@ -71,6 +71,11 @@ public class SystemPropertiesUtils {
     boolean needReWrite = false;
 
     // Startup configuration
+    String clusterName = systemProperties.getProperty(CLUSTER_NAME, null);
+    if (clusterName != null && !clusterName.equals(conf.getClusterName())) {
+      throw new ConfigurationException(CLUSTER_NAME, conf.getClusterName(), 
clusterName);
+    }
+
     String internalAddress = 
systemProperties.getProperty("cn_internal_address", null);
     if (internalAddress == null) {
       needReWrite = true;
diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index a1f76fae76..f7318c9969 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -275,14 +275,8 @@ public class ConfigNode implements ConfigNodeMBean {
       } else if (status.getCode() == 
TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode()) {
         targetConfigNode = status.getRedirectNode();
         LOGGER.info("ConfigNode need redirect to  {}.", targetConfigNode);
-      } else if (status.getCode() == 
TSStatusCode.CONFIGURATION_ERROR.getStatusCode()) {
-        LOGGER.error(status.getMessage());
-        throw new StartupException("Configuration are not consistent!");
-      } else if (status.getCode() == 
TSStatusCode.CONSENSUS_NOT_INITIALIZED.getStatusCode()) {
-        LOGGER.error(status.getMessage());
-        throw new StartupException(
-            "The target ConfigNode is not started successfully, "
-                + "please check the cn_target_config_node_list config!");
+      } else {
+        throw new StartupException(status.getMessage());
       }
 
       try {
diff --git 
a/server/src/main/java/org/apache/iotdb/db/mpp/common/header/ColumnHeaderConstant.java
 
b/server/src/main/java/org/apache/iotdb/db/mpp/common/header/ColumnHeaderConstant.java
index 7bef5278a7..ebddd19f06 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/mpp/common/header/ColumnHeaderConstant.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/mpp/common/header/ColumnHeaderConstant.java
@@ -58,7 +58,7 @@ public class ColumnHeaderConstant {
   public static final String VERSION = "Version";
   public static final String BUILD_INFO = "BuildInfo";
   public static final String PATHS = "Paths";
-  public static final String VARIABLES = "Variables";
+  public static final String VARIABLE = "Variable";
 
   // column names for count statement
   public static final String COLUMN = "Column";
@@ -292,7 +292,7 @@ public class ColumnHeaderConstant {
 
   public static final List<ColumnHeader> showVariablesColumnHeaders =
       ImmutableList.of(
-          new ColumnHeader(VARIABLES, TSDataType.TEXT), new 
ColumnHeader(VALUE, TSDataType.TEXT));
+          new ColumnHeader(VARIABLE, TSDataType.TEXT), new ColumnHeader(VALUE, 
TSDataType.TEXT));
 
   public static final List<ColumnHeader> showFunctionsColumnHeaders =
       ImmutableList.of(

Reply via email to