This is an automated email from the ASF dual-hosted git repository.
tanxinyu 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 6cca2e1b1e1 Fix print a log every time startup and error exception
handling (#13545)
6cca2e1b1e1 is described below
commit 6cca2e1b1e1e5ebf3cce524bfa67e5f27edb8ec2
Author: 133tosakarin <[email protected]>
AuthorDate: Thu Sep 19 14:23:39 2024 +0800
Fix print a log every time startup and error exception handling (#13545)
---
.../java/org/apache/iotdb/db/schemaengine/SchemaEngine.java | 10 ++++++----
.../src/main/java/org/apache/iotdb/db/service/DataNode.java | 7 ++++++-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
index 3740a7ef0dc..e3ef823b144 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/SchemaEngine.java
@@ -195,13 +195,15 @@ public class SchemaEngine {
localSchemaRegionInfo.forEach(
(k, v) -> {
for (SchemaRegionId schemaRegionId : v) {
+ PartialPath database;
try {
- futures.add(
- schemaRegionRecoverPools.submit(
- recoverSchemaRegionTask(new PartialPath(k),
schemaRegionId)));
+ database = new PartialPath(k);
} catch (IllegalPathException e) {
- throw new RuntimeException(e);
+ logger.warn("Illegal database path: {}", k);
+ continue;
}
+ futures.add(
+
schemaRegionRecoverPools.submit(recoverSchemaRegionTask(database,
schemaRegionId)));
}
});
for (final Future<ISchemaRegion> future : futures) {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 7aa5eedd20c..501be863387 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -571,6 +571,9 @@ public class DataNode extends ServerCommandLine implements
DataNodeMBean {
DataRegionConsensusImpl.getInstance().getAllConsensusGroupIdsWithoutStarting().stream()
.filter(consensusGroupId ->
!dataNodeConsensusGroupIds.contains(consensusGroupId))
.collect(Collectors.toList());
+ if (invalidDataRegionConsensusGroupIds.isEmpty()) {
+ return;
+ }
logger.info("Remove invalid dataRegion directories... {}",
invalidDataRegionConsensusGroupIds);
for (ConsensusGroupId consensusGroupId :
invalidDataRegionConsensusGroupIds) {
File oldDir =
@@ -610,9 +613,11 @@ public class DataNode extends ServerCommandLine implements
DataNodeMBean {
SchemaRegionConsensusImpl.getInstance().getAllConsensusGroupIdsWithoutStarting().stream()
.filter(consensusGroupId ->
!dataNodeConsensusGroupIds.contains(consensusGroupId))
.collect(Collectors.toList());
+ if (invalidSchemaRegionConsensusGroupIds.isEmpty()) {
+ return;
+ }
logger.info(
"Remove invalid schemaRegion directories... {}",
invalidSchemaRegionConsensusGroupIds);
-
for (ConsensusGroupId consensusGroupId :
invalidSchemaRegionConsensusGroupIds) {
File oldDir =
new File(