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

haonan 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 044d12ca63 Adapt wal memtabe snapshot to new cluster (#6138)
044d12ca63 is described below

commit 044d12ca63ac5f839e6e92208040ee956625c2e7
Author: Alan Choo <[email protected]>
AuthorDate: Wed Jun 1 22:52:54 2022 +0800

    Adapt wal memtabe snapshot to new cluster (#6138)
---
 .../java/org/apache/iotdb/db/wal/node/WALNode.java     | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java 
b/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
index 5b9ce10eb0..9c3a3241ab 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
@@ -19,6 +19,7 @@
 package org.apache.iotdb.db.wal.node;
 
 import org.apache.iotdb.commons.conf.IoTDBConstant;
+import org.apache.iotdb.commons.consensus.DataRegionId;
 import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.file.SystemFileFactory;
 import org.apache.iotdb.commons.path.PartialPath;
@@ -27,6 +28,7 @@ import 
org.apache.iotdb.consensus.common.request.IConsensusRequest;
 import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.engine.StorageEngine;
+import org.apache.iotdb.db.engine.StorageEngineV2;
 import org.apache.iotdb.db.engine.flush.FlushStatus;
 import org.apache.iotdb.db.engine.memtable.IMemTable;
 import org.apache.iotdb.db.engine.storagegroup.DataRegion;
@@ -301,11 +303,17 @@ public class WALNode implements IWALNode {
           
FSFactoryProducer.getFSFactory().getFile(oldestMemTableInfo.getTsFilePath());
       DataRegion dataRegion;
       try {
-        dataRegion =
-            StorageEngine.getInstance()
-                .getProcessorByDataRegionId(
-                    new PartialPath(TsFileUtils.getStorageGroup(oldestTsFile)),
-                    TsFileUtils.getDataRegionId(oldestTsFile));
+        if (config.isMppMode()) {
+          dataRegion =
+              StorageEngineV2.getInstance()
+                  .getDataRegion(new 
DataRegionId(TsFileUtils.getDataRegionId(oldestTsFile)));
+        } else {
+          dataRegion =
+              StorageEngine.getInstance()
+                  .getProcessorByDataRegionId(
+                      new 
PartialPath(TsFileUtils.getStorageGroup(oldestTsFile)),
+                      TsFileUtils.getDataRegionId(oldestTsFile));
+        }
       } catch (IllegalPathException | StorageEngineException e) {
         logger.error("Fail to get virtual storage group processor for {}", 
oldestTsFile, e);
         return;

Reply via email to