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

tanxinyu pushed a commit to branch rc/1.3.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rc/1.3.3 by this push:
     new fdd7e8b08bf Fix print a log every time startup and  error exception 
handling (#13545) (#13546)
fdd7e8b08bf is described below

commit fdd7e8b08bf27ad6340e33a893c0539e39fb8699
Author: 133tosakarin <[email protected]>
AuthorDate: Thu Sep 19 23:12:47 2024 +0800

    Fix print a log every time startup and  error exception handling (#13545) 
(#13546)
---
 .../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 f322d955708..0ad1cc6f10b 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
@@ -203,13 +203,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 2479640353e..1c018c0e507 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
@@ -567,6 +567,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 =
@@ -606,9 +609,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(

Reply via email to