This is an automated email from the ASF dual-hosted git repository.
ericpai 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 2d9dd5be83 [IOTDB-4814] Using 1C1D as the default mode in integration
test (#7855)
2d9dd5be83 is described below
commit 2d9dd5be833f9452adccee41dd57ccdb2e2324aa
Author: BaiJian <[email protected]>
AuthorDate: Wed Nov 2 09:22:19 2022 +0800
[IOTDB-4814] Using 1C1D as the default mode in integration test (#7855)
---
.../{cluster-it.yml => cluster-it-1c1d.yml} | 15 ++--
.../{cluster-it.yml => cluster-it-1c3d.yml} | 7 +-
.github/workflows/main-unix.yml | 5 +-
.github/workflows/standalone-it-for-mpp.yml | 79 ----------------------
integration-test/README.md | 50 +++++++-------
integration-test/pom.xml | 23 ++-----
.../org/apache/iotdb/it/env/ConfigFactory.java | 41 ++++-------
.../org/apache/iotdb/it/env/DataNodeWrapper.java | 1 +
.../java/org/apache/iotdb/it/env/EnvFactory.java | 20 +++---
...StandaloneDataNodeWrapper.java => EnvType.java} | 16 ++---
.../{StandaloneOnMppEnv.java => OneCopyEnv.java} | 22 +-----
pom.xml | 3 +-
.../resources/conf/iotdb-datanode.properties | 4 ++
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 12 ++--
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 5 ++
.../java/org/apache/iotdb/db/service/DataNode.java | 4 +-
16 files changed, 104 insertions(+), 203 deletions(-)
diff --git a/.github/workflows/cluster-it.yml
b/.github/workflows/cluster-it-1c1d.yml
similarity index 89%
copy from .github/workflows/cluster-it.yml
copy to .github/workflows/cluster-it-1c1d.yml
index 323bb31829..9b566ad2ef 100644
--- a/.github/workflows/cluster-it.yml
+++ b/.github/workflows/cluster-it-1c1d.yml
@@ -1,4 +1,4 @@
-name: New Cluster IT
+name: Cluster IT - OneCopy
on:
push:
@@ -22,13 +22,16 @@ env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3
jobs:
- ClusterIT:
+ OneCopy:
strategy:
fail-fast: false
max-parallel: 20
matrix:
java: [ 8, 11, 17 ]
- os: [ ubuntu-latest, macos-latest, windows-latest ]
+ os: [ ubuntu-latest, windows-latest ]
+ include:
+ - java: 8
+ os: macos-latest
runs-on: ${{ matrix.os }}
steps:
@@ -68,12 +71,14 @@ jobs:
run: |
mvn clean verify \
-DskipUTs \
+ -DintegrationTest.forkCount=2 \
-pl integration-test \
- -am -PClusterIT
+ -am
- name: Upload Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
- name: cluster-log-java${{ matrix.java }}-${{ runner.os }}
+ name: standalone-log-java${{ matrix.java }}-${{ runner.os }}
path: integration-test/target/cluster-logs
retention-days: 1
+
diff --git a/.github/workflows/cluster-it.yml
b/.github/workflows/cluster-it-1c3d.yml
similarity index 94%
rename from .github/workflows/cluster-it.yml
rename to .github/workflows/cluster-it-1c3d.yml
index 323bb31829..18a88b9441 100644
--- a/.github/workflows/cluster-it.yml
+++ b/.github/workflows/cluster-it-1c3d.yml
@@ -1,4 +1,4 @@
-name: New Cluster IT
+name: Cluster IT - 1C3D
on:
push:
@@ -28,7 +28,10 @@ jobs:
max-parallel: 20
matrix:
java: [ 8, 11, 17 ]
- os: [ ubuntu-latest, macos-latest, windows-latest ]
+ os: [ ubuntu-latest, windows-latest ]
+ include:
+ - java: 8
+ os: macos-latest
runs-on: ${{ matrix.os }}
steps:
diff --git a/.github/workflows/main-unix.yml b/.github/workflows/main-unix.yml
index 49d4ed369e..790e9d5970 100644
--- a/.github/workflows/main-unix.yml
+++ b/.github/workflows/main-unix.yml
@@ -35,7 +35,10 @@ jobs:
max-parallel: 20
matrix:
java: [ 8, 11, 17 ]
- os: [ ubuntu-latest, macos-latest ]
+ os: [ ubuntu-latest ]
+ include:
+ - java: 8
+ os: macos-latest
runs-on: ${{ matrix.os}}
steps:
diff --git a/.github/workflows/standalone-it-for-mpp.yml
b/.github/workflows/standalone-it-for-mpp.yml
deleted file mode 100644
index 7821890738..0000000000
--- a/.github/workflows/standalone-it-for-mpp.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-#name: New Standalone IT
-#
-#on:
-## push:
-## branches:
-## paths-ignore:
-## - 'docs/**'
-## pull_request:
-## branches:
-## paths-ignore:
-## - 'docs/**'
-## # allow manually run the action:
-## workflow_dispatch:
-#
-#concurrency:
-# group: ${{ github.workflow }}-${{ github.ref }}
-# cancel-in-progress: true
-#
-#env:
-# MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3
-#
-#jobs:
-# StandaloneMppIT:
-# strategy:
-# fail-fast: false
-# max-parallel: 20
-# matrix:
-# java: [ 8, 11, 17 ]
-# os: [ ubuntu-latest, macos-latest, windows-latest ]
-# runs-on: ${{ matrix.os }}
-#
-# steps:
-# - uses: actions/checkout@v2
-# - name: Set up JDK ${{ matrix.java }}
-# uses: actions/setup-java@v1
-# with:
-# java-version: ${{ matrix.java }}
-# - name: Cache Maven packages
-# uses: actions/cache@v2
-# with:
-# path: ~/.m2
-# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
-# restore-keys: ${{ runner.os }}-m2-
-# - name: Check Apache Rat
-# run: mvn -B apache-rat:check -P site -P code-coverage
-# - name: Adjust network dynamic TCP ports range
-# if: ${{ runner.os == 'Windows' }}
-# shell: pwsh
-# run: |
-# netsh int ipv4 set dynamicport tcp start=32768 num=32768
-# netsh int ipv4 set dynamicport udp start=32768 num=32768
-# netsh int ipv6 set dynamicport tcp start=32768 num=32768
-# netsh int ipv6 set dynamicport udp start=32768 num=32768
-# - name: Adjust Linux kernel somaxconn
-# if: ${{ runner.os == 'Linux' }}
-# shell: bash
-# run: sudo sysctl -w net.core.somaxconn=65535
-# - name: Adjust Mac kernel somaxconn
-# if: ${{ runner.os == 'macOS' }}
-# shell: bash
-# run: sudo sysctl -w kern.ipc.somaxconn=65535
-# - name: IT/UT Test
-# shell: bash
-# # we do not compile client-cpp for saving time, it is tested in
client.yml
-# # we can skip influxdb-protocol because it has been tested separately
in influxdb-protocol.yml
-# run: |
-# mvn clean verify \
-# -DskipUTs \
-# -DintegrationTest.forkCount=2 \
-# -pl integration-test \
-# -am -PLocalStandaloneOnMppIT
-# - name: Upload Artifact
-# if: failure()
-# uses: actions/upload-artifact@v3
-# with:
-# name: standalone-log-java${{ matrix.java }}-${{ runner.os }}
-# path: integration-test/target/cluster-logs
-# retention-days: 1
-#
diff --git a/integration-test/README.md b/integration-test/README.md
index f2c8526b2d..f0bec7cd0a 100644
--- a/integration-test/README.md
+++ b/integration-test/README.md
@@ -19,31 +19,32 @@
-->
-Integration Test For the MPP Architecture
-===================
+# Integration Test User Guide
-Integration test for the mpp architecture are in this module.
+Integration tests for IoTDB are in this module.
-Now integration testing supports the Cluster mode and the Local Standalone
mode.
+Now integration testing supports two kinds of architecture.
-Integration Testing with Cluster Mode
--------------------
+- `OneCopy`: A cluster with 1 config node and 1 data node.
+- `Cluster1`: A cluster with 1 config node and 3 data nodes.
-You can run the integration test in cluster mode. At present, we have
implemented a pseudo cluster with 1 config nodes and 3 data nodes.
-(As the test cases and the test environment are decoupled, we can easily
implement other pseudo cluster or even a docker-based cluster later.)
+## Integration Testing with One Copy Mode
+
+Integration testing in `OneCopy` mode can be run with both maven and IDEs like
IntelliJ easily.
The maven command is:
```
-mvn clean verify -DskipUTs -pl integration-test -am -PClusterIT
+mvn clean verify -DskipUTs -pl integration-test -am
```
+
Notice that, this above maven command only run IT.
--------
+And if you want to run IT in the IDE like IntelliJ, you need to achieve the
effect as the `OneCopyIT` profile in maven, which has already been set by
default. Follow Steps 1-4 to achieve it.
-Run in IntelliJ in cluster mode is so easy,
-- Step 0. Optionally, when you run the test for the first time, or when you
change the code of the module that the integration test module depends on, you
may need to use the following command to generate
`integration-test/target/template-node` for nodes of the pseudo cluster.
+- Step 0. Optionally, when you run the test for the first time, or when you
change the code of the module that the integration test module depends on, you
may need to use the following command to generate
`integration-test/target/template-node` for the node to be tested.
+
```
-mvn clean package -DskipTests -pl integration-test -am -PClusterIT
+mvn clean package -DskipTests -pl integration-test -am
```
- Step 1. Run(Menu) -> Edit Configurations...
@@ -55,25 +56,26 @@ mvn clean package -DskipTests -pl integration-test -am
-PClusterIT
- Step 3. Input some fields as the following picture
- 
+ 
-Integration Testing with Local Standalone Mode
--------------------
+## Integration Testing with Cluster Mode
-Integration testing with local standalone mode can be run with both maven and
IDEs like IntelliJ.
+You can run the integration test in a 'real' cluster mode. At present, we have
implemented a pseudo cluster with 1 config nodes and 3 data nodes.
+(As the test cases and the test environment are decoupled, we can easily
implement other pseudo cluster or even a docker-based cluster later.)
The maven command is:
```
-mvn clean verify -DskipUTs -pl integration-test -am -PLocalStandaloneOnMppIT
+mvn clean verify -DskipUTs -pl integration-test -am -PClusterIT
```
--------
-And if you want to run IT in the IDE like IntelliJ, you need to achieve the
effect as the `LocalStandaloneOnMppIT` profile in maven. Follow Steps 1-4 to
achieve it.
+If you want to run IT in `Cluster1` mode in the IDE like IntelliJ, you need to
achieve the effect as the `ClusterIT` profile in maven explicitly. Follow Steps
1-4 to achieve it, which are almost the same as `OneCopy`.
-- Step 0. Optionally, when you run the test for the first time, or when you
change the code of the module that the integration test module depends on, you
may need to use the following command to generate
`integration-test/target/template-node` for the node of the local standalone.
-It has the same effect as step 0 of the cluster mode counterpart; these two
command's generations are the same content.
+
+- Step 0. Optionally, when you run the test for the first time, or when you
change the code of the module that the integration test module depends on, you
may need to use the following command to generate
`integration-test/target/template-node` for nodes of the pseudo cluster.
+
+ It has the same effect as step 0 of the `OneCopy` counterpart; these two
commands' generations are the same content.
```
-mvn clean package -DskipTests -pl integration-test -am -PLocalStandaloneOnMppIT
+mvn clean package -DskipTests -pl integration-test
```
- Step 1. Run(Menu) -> Edit Configurations...
@@ -85,4 +87,4 @@ mvn clean package -DskipTests -pl integration-test -am
-PLocalStandaloneOnMppIT
- Step 3. Input some fields as the following picture
- 
+ 
\ No newline at end of file
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index e5d8b9fe1a..a01c5c288d 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -209,11 +209,15 @@
</build>
<profiles>
<profile>
- <id>LocalStandaloneIT</id>
+ <id>OneCopyIT</id>
<properties>
<integrationTest.includedGroups>org.apache.iotdb.itbase.category.LocalStandaloneIT</integrationTest.includedGroups>
<integrationTest.excludedGroups/>
- <integrationTest.testEnv>Standalone</integrationTest.testEnv>
+ <integrationTest.testEnv>OneCopy</integrationTest.testEnv>
+
<integrationTest.launchNodeInSameJVM>false</integrationTest.launchNodeInSameJVM>
+
<integrationTest.randomSelectWriteNode>false</integrationTest.randomSelectWriteNode>
+
<integrationTest.readAndVerifyWithMultiNode>false</integrationTest.readAndVerifyWithMultiNode>
+
<integrationTest.parallelMode>classes</integrationTest.parallelMode>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
@@ -246,20 +250,5 @@
<activeByDefault>false</activeByDefault>
</activation>
</profile>
- <profile>
- <id>LocalStandaloneOnMppIT</id>
- <properties>
-
<integrationTest.includedGroups>org.apache.iotdb.itbase.category.LocalStandaloneIT</integrationTest.includedGroups>
- <integrationTest.excludedGroups/>
-
<integrationTest.testEnv>LocalStandaloneOnMpp</integrationTest.testEnv>
-
<integrationTest.launchNodeInSameJVM>false</integrationTest.launchNodeInSameJVM>
-
<integrationTest.randomSelectWriteNode>false</integrationTest.randomSelectWriteNode>
-
<integrationTest.readAndVerifyWithMultiNode>false</integrationTest.readAndVerifyWithMultiNode>
-
<integrationTest.parallelMode>classes</integrationTest.parallelMode>
- </properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- </profile>
</profiles>
</project>
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
index 22f48193b5..639a963dff 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
@@ -20,39 +20,24 @@ package org.apache.iotdb.it.env;
import org.apache.iotdb.itbase.env.BaseConfig;
-import java.lang.reflect.InvocationTargetException;
-
public class ConfigFactory {
private static BaseConfig config;
public static BaseConfig getConfig() {
if (config == null) {
- try {
- switch (System.getProperty("TestEnv", "Standalone")) {
- case "Standalone":
- config =
- (BaseConfig)
-
Class.forName("org.apache.iotdb.db.it.env.StandaloneEnvConfig")
- .getDeclaredConstructor()
- .newInstance();
- break;
- case "LocalStandaloneOnMpp":
- case "Cluster1":
- config = new MppConfig();
- break;
- case "Remote":
- config = new RemoteServerConfig();
- break;
- default:
- throw new ClassNotFoundException("The Property class of TestEnv
not found");
- }
- } catch (ClassNotFoundException
- | IllegalAccessException
- | InstantiationException
- | NoSuchMethodException
- | InvocationTargetException e) {
- e.printStackTrace();
- System.exit(-1);
+ EnvType env = EnvType.getSystemEnvType();
+ switch (env) {
+ case OneCopy:
+ case Cluster1:
+ config = new MppConfig();
+ break;
+ case Remote:
+ config = new RemoteServerConfig();
+ break;
+ default:
+ System.out.println("Unknown env type: " + env);
+ System.exit(-1);
+ break;
}
}
return config;
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
index 8efd6f99fc..55f0e62ea1 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
+++
b/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
@@ -58,6 +58,7 @@ public class DataNodeWrapper extends AbstractNodeWrapper {
"dn_data_region_consensus_port",
String.valueOf(this.dataRegionConsensusPort));
properties.setProperty(
"dn_schema_region_consensus_port",
String.valueOf(this.schemaRegionConsensusPort));
+ properties.setProperty("dn_join_cluster_retry_interval_ms", "1000");
properties.setProperty("mqtt_host", super.getIp());
properties.setProperty("mqtt_port", String.valueOf(this.mqttPort));
properties.setProperty("connection_timeout_ms", "30000");
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
index 614a640180..b275ce7440 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
@@ -33,23 +33,23 @@ public class EnvFactory {
try {
Class.forName(Config.JDBC_DRIVER_NAME);
logger.debug(">>>>>>>" + System.getProperty("TestEnv"));
- switch (System.getProperty("TestEnv", "Standalone")) {
- case "Standalone":
- env = (BaseEnv)
Class.forName("org.apache.iotdb.db.it.env.StandaloneEnv").newInstance();
+ EnvType envType = EnvType.getSystemEnvType();
+ switch (envType) {
+ case OneCopy:
+ env = new OneCopyEnv();
break;
- case "LocalStandaloneOnMpp":
- env = new StandaloneOnMppEnv();
- break;
- case "Cluster1":
+ case Cluster1:
env = new Cluster1Env();
break;
- case "Remote":
+ case Remote:
env = new RemoteServerEnv();
break;
default:
- throw new ClassNotFoundException("The Property class of TestEnv
not found");
+ System.out.println("Unknown env type: " + envType);
+ System.exit(-1);
+ break;
}
- } catch (ClassNotFoundException | IllegalAccessException |
InstantiationException e) {
+ } catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(-1);
}
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneDataNodeWrapper.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvType.java
similarity index 69%
rename from
integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneDataNodeWrapper.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/EnvType.java
index 3c245f3ae5..e88d958069 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneDataNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvType.java
@@ -18,15 +18,13 @@
*/
package org.apache.iotdb.it.env;
-public class StandaloneDataNodeWrapper extends DataNodeWrapper {
+public enum EnvType {
+ Remote,
+ OneCopy,
+ Cluster1;
- public StandaloneDataNodeWrapper(
- String targetConfigNode, String testClassName, String testMethodName,
int[] portList) {
- super(targetConfigNode, testClassName, testMethodName, portList);
- }
-
- @Override
- protected String mainClassName() {
- return "org.apache.iotdb.db.service.NewIoTDB";
+ public static EnvType getSystemEnvType() {
+ String envValue = System.getProperty("TestEnv", OneCopy.name());
+ return EnvType.valueOf(envValue);
}
}
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneOnMppEnv.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/OneCopyEnv.java
similarity index 67%
rename from
integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneOnMppEnv.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/OneCopyEnv.java
index d770a5b464..bf438ce882 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/env/StandaloneOnMppEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/OneCopyEnv.java
@@ -22,30 +22,14 @@ import org.apache.iotdb.it.framework.IoTDBTestLogger;
import org.slf4j.Logger;
-import java.util.Collections;
-
-public class StandaloneOnMppEnv extends AbstractEnv {
+public class OneCopyEnv extends AbstractEnv {
private static final Logger logger = IoTDBTestLogger.logger;
- private void initEnvironment() {
- DataNodeWrapper dataNodeWrapper =
- new StandaloneDataNodeWrapper(
- null,
- super.getTestClassName(),
- super.getTestMethodName(),
- EnvUtils.searchAvailablePorts());
- dataNodeWrapper.createDir();
-
dataNodeWrapper.changeConfig(ConfigFactory.getConfig().getEngineProperties());
- dataNodeWrapper.start();
- super.dataNodeWrapperList = Collections.singletonList(dataNodeWrapper);
- super.testWorking();
- }
-
@Override
public void initBeforeClass() throws InterruptedException {
logger.debug("=======start init class=======");
- initEnvironment();
+ super.initEnvironment(1, 1);
}
@Override
@@ -56,6 +40,6 @@ public class StandaloneOnMppEnv extends AbstractEnv {
@Override
public void initBeforeTest() {
logger.debug("=======start init test=======");
- initEnvironment();
+ initEnvironment(1, 1);
}
}
diff --git a/pom.xml b/pom.xml
index f75a26a0fd..fc527b3d96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -766,9 +766,10 @@
<exclude>**/*.json</exclude>
<!-- the zeppelin export file format-->
<exclude>**/*.zpln</exclude>
- <!-- exclude go.mod and go.sum in iotdb-client-go
submodule-->
+ <!-- exclude go.mod, go.sum and rpc/* in
iotdb-client-go submodule-->
<exclude>**/go.mod</exclude>
<exclude>**/go.sum</exclude>
+ <exclude>client-go/rpc/*</exclude>
<!-- python -->
<exclude>.pytest_cache/**</exclude>
<exclude>venv/**</exclude>
diff --git a/server/src/assembly/resources/conf/iotdb-datanode.properties
b/server/src/assembly/resources/conf/iotdb-datanode.properties
index 4a2faa57b6..b90c723699 100644
--- a/server/src/assembly/resources/conf/iotdb-datanode.properties
+++ b/server/src/assembly/resources/conf/iotdb-datanode.properties
@@ -49,6 +49,10 @@ dn_data_region_consensus_port=40010
# port for consensus's communication for schema region between cluster nodes.
dn_schema_region_consensus_port=50010
+# Datatype: long
+# The time of data node waiting for the next retry to join into the cluster.
+dn_join_cluster_retry_interval_ms=5000
+
####################
### Target Config Nodes
####################
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index f819e10d11..725e6761a8 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -880,8 +880,8 @@ public class IoTDBConfig {
private List<TEndPoint> targetConfigNodeList =
Collections.singletonList(new TEndPoint("127.0.0.1", 22277));
- /** The max time of data node waiting to join into the cluster */
- private long joinClusterTimeOutMs = TimeUnit.SECONDS.toMillis(5);
+ /** The time of data node waiting for the next retry to join into the
cluster */
+ private long joinClusterRetryIntervalMs = TimeUnit.SECONDS.toMillis(5);
/**
* The consensus protocol class for data region. The Datanode should
communicate with ConfigNode
@@ -2957,12 +2957,12 @@ public class IoTDBConfig {
this.targetConfigNodeList = targetConfigNodeList;
}
- public long getJoinClusterTimeOutMs() {
- return joinClusterTimeOutMs;
+ public long getJoinClusterRetryIntervalMs() {
+ return joinClusterRetryIntervalMs;
}
- public void setJoinClusterTimeOutMs(long joinClusterTimeOutMs) {
- this.joinClusterTimeOutMs = joinClusterTimeOutMs;
+ public void setJoinClusterRetryIntervalMs(long joinClusterRetryIntervalMs) {
+ this.joinClusterRetryIntervalMs = joinClusterRetryIntervalMs;
}
public String getDataRegionConsensusProtocolClass() {
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index 766cbf7ab8..4ec662803d 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -1866,6 +1866,11 @@ public class IoTDBDescriptor {
properties.getProperty(
"dn_schema_region_consensus_port",
Integer.toString(conf.getSchemaRegionConsensusPort()))));
+ conf.setJoinClusterRetryIntervalMs(
+ Long.parseLong(
+ properties.getProperty(
+ "dn_join_cluster_retry_interval_ms",
+ Long.toString(conf.getJoinClusterRetryIntervalMs()))));
}
public void loadShuffleProps(Properties properties) {
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 9b20de50f6..774f84074c 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -257,8 +257,8 @@ public class DataNode implements DataNodeMBean {
}
try {
- // wait 5s to start the next try
- Thread.sleep(config.getJoinClusterTimeOutMs());
+ // wait to start the next try
+ Thread.sleep(config.getJoinClusterRetryIntervalMs());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.warn("Unexpected interruption when waiting to register to the
cluster", e);