You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/04/12 04:06:53 UTC

[iotdb] branch storageEngineV2 created (now 7b873f6a65)

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

haonan pushed a change to branch storageEngineV2
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 7b873f6a65 fix StorageEngineV2 cannot start

This branch includes the following new commits:

     new 7b873f6a65 fix StorageEngineV2 cannot start

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: fix StorageEngineV2 cannot start

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7b873f6a65730d42b5ba4d386c6317a8661ab7d4
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Apr 12 11:56:07 2022 +0800

    fix StorageEngineV2 cannot start
---
 .../java/org/apache/iotdb/db/engine/StorageEngineV2.java     | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
index 4763be6584..5040d2a1d3 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
@@ -50,6 +50,7 @@ import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.rescon.SystemInfo;
 import org.apache.iotdb.db.utils.ThreadUtils;
 import org.apache.iotdb.db.utils.UpgradeUtils;
+import org.apache.iotdb.db.wal.recover.WALRecoverManager;
 import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.tsfile.utils.FilePathUtils;
@@ -227,13 +228,22 @@ public class StorageEngineV2 implements IService {
   private void getLocalDataRegion() throws MetadataException, DataRegionException {
     File system = SystemFileFactory.INSTANCE.getFile(systemDir);
     File[] sgDirs = system.listFiles();
+    int sgCount = 0;
+    for (File sgDir : sgDirs) {
+      if (!sgDir.isDirectory()) {
+        sgCount++;
+      }
+    }
+    // init wal recover manager
+    WALRecoverManager.getInstance()
+        .setAllDataRegionScannedLatch(new CountDownLatch(sgCount * config.getDataRegionNum()));
     for (File sgDir : sgDirs) {
       if (!sgDir.isDirectory()) {
         continue;
       }
       String sg = sgDir.getName();
       // TODO: need to get TTL Info from config node
-      long ttl = Integer.MAX_VALUE;
+      long ttl = Long.MAX_VALUE;
       for (File dataRegionDir : sgDir.listFiles()) {
         if (!dataRegionDir.isDirectory()) {
           continue;