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

yongzao 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 89c2af83e2a Cancel that submit the 
DataPartitionTableIntegrityCheckProcedure when ConfigNode start up. (#17506)
89c2af83e2a is described below

commit 89c2af83e2a4fa17c2cad36ec5f247985f4032ff
Author: libo <[email protected]>
AuthorDate: Fri Apr 17 17:26:00 2026 +0800

    Cancel that submit the DataPartitionTableIntegrityCheckProcedure when 
ConfigNode start up. (#17506)
---
 .../iotdb/confignode/service/ConfigNode.java       | 65 +---------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 5caac7127f7..0d8e299ebc8 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -24,8 +24,6 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.ServerCommandLine;
 import org.apache.iotdb.commons.client.ClientManagerMetrics;
-import org.apache.iotdb.commons.cluster.NodeStatus;
-import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
 import org.apache.iotdb.commons.concurrent.ThreadModule;
 import org.apache.iotdb.commons.concurrent.ThreadName;
 import org.apache.iotdb.commons.concurrent.ThreadPoolMetrics;
@@ -55,7 +53,6 @@ import org.apache.iotdb.confignode.manager.ConfigManager;
 import org.apache.iotdb.confignode.manager.consensus.ConsensusManager;
 import org.apache.iotdb.confignode.manager.pipe.agent.PipeConfigNodeAgent;
 import org.apache.iotdb.confignode.manager.pipe.metric.PipeConfigNodeMetrics;
-import 
org.apache.iotdb.confignode.procedure.impl.partition.DataPartitionTableIntegrityCheckProcedure;
 import org.apache.iotdb.confignode.rpc.thrift.TConfigNodeRegisterReq;
 import org.apache.iotdb.confignode.rpc.thrift.TConfigNodeRegisterResp;
 import org.apache.iotdb.confignode.rpc.thrift.TNodeVersionInfo;
@@ -82,9 +79,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 public class ConfigNode extends ServerCommandLine implements ConfigNodeMBean {
@@ -116,11 +110,6 @@ public class ConfigNode extends ServerCommandLine 
implements ConfigNodeMBean {
 
   private int exitStatusCode = 0;
 
-  private Future<Void> dataPartitionTableCheckFuture;
-
-  private ExecutorService dataPartitionTableCheckExecutor =
-      
IoTDBThreadPoolFactory.newSingleThreadExecutor("DATA_PARTITION_TABLE_CHECK");
-
   public ConfigNode() {
     super("ConfigNode");
     // We do not init anything here, so that we can re-initialize the instance 
in IT.
@@ -158,15 +147,6 @@ public class ConfigNode extends ServerCommandLine 
implements ConfigNodeMBean {
     }
     active();
     LOGGER.info("IoTDB started");
-    if (dataPartitionTableCheckFuture != null) {
-      try {
-        dataPartitionTableCheckFuture.get();
-      } catch (ExecutionException | InterruptedException e) {
-        LOGGER.error("Data partition table check task execute failed", e);
-      } finally {
-        dataPartitionTableCheckExecutor.shutdownNow();
-      }
-    }
   }
 
   @Override
@@ -195,10 +175,7 @@ public class ConfigNode extends ServerCommandLine 
implements ConfigNodeMBean {
         int configNodeId = CONF.getConfigNodeId();
         configManager.initConsensusManager();
         upgrade();
-        TConfigNodeLocation leaderNodeLocation = waitForLeaderElected();
-        if (leaderNodeLocation == null) {
-          leaderNodeLocation = 
configManager.getConsensusManager().getNotNullLeaderLocation();
-        }
+        waitForLeaderElected();
         setUpMetricService();
         // Notice: We always set up Seed-ConfigNode's RPC service lastly to 
ensure
         // that the external service is not provided until ConfigNode is fully 
available
@@ -226,46 +203,6 @@ public class ConfigNode extends ServerCommandLine 
implements ConfigNodeMBean {
         }
         loadSecretKey();
         loadHardwareCode();
-
-        /* After the ConfigNode leader election, a leader switch may occur, 
which could cause the procedure not to be created. This can happen if the 
original leader has not yet executed the procedure creation, while the other 
followers have already finished starting up. Therefore, having the original 
leader (before the leader switch) initiate the process ensures that only one 
procedure will be created. */
-        if (leaderNodeLocation.getConfigNodeId() == configNodeId) {
-          if (!configManager
-              .getProcedureManager()
-              
.isExistUnfinishedProcedure(DataPartitionTableIntegrityCheckProcedure.class)) {
-            dataPartitionTableCheckFuture =
-                dataPartitionTableCheckExecutor.submit(
-                    () -> {
-                      LOGGER.info(
-                          "[DataPartitionIntegrity] Prepare to start 
dataPartitionTableIntegrityCheck after all datanodes started up");
-                      
Thread.sleep(CONF.getPartitionTableRecoverWaitAllDnUpTimeoutInMs());
-
-                      while (true) {
-                        List<Integer> dnList =
-                            configManager
-                                .getLoadManager()
-                                
.filterDataNodeThroughStatus(NodeStatus.Running);
-                        if (dnList != null && !dnList.isEmpty()) {
-                          LOGGER.info("Starting 
dataPartitionTableIntegrityCheck...");
-                          TSStatus status =
-                              configManager
-                                  .getProcedureManager()
-                                  .dataPartitionTableIntegrityCheck();
-                          if (status.getCode() != 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-                            LOGGER.error(
-                                "Data partition table integrity check failed! 
Current status code is {}, status message is {}",
-                                status.getCode(),
-                                status.getMessage());
-                          }
-                          break;
-                        } else {
-                          LOGGER.info("No running datanodes found, 
waiting...");
-                          Thread.sleep(5000);
-                        }
-                      }
-                      return null;
-                    });
-          }
-        }
         return;
       } else {
         saveSecretKey();

Reply via email to