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/11/29 01:23:37 UTC

[iotdb] branch IOTDB-5045 created (now 97fec340cc)

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

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


      at 97fec340cc [IOTDB-5045] fix delete database, wal and tsfile still left

This branch includes the following new commits:

     new 97fec340cc [IOTDB-5045] fix delete database, wal and tsfile still left

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: [IOTDB-5045] fix delete database, wal and tsfile still left

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

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

commit 97fec340cc9a67ac16cd746b98e50fbd3a61cecb
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Nov 29 09:23:19 2022 +0800

    [IOTDB-5045] fix delete database, wal and tsfile still left
---
 server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java      | 2 +-
 .../src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java   | 2 +-
 .../java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java    | 6 ++++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index a55c11bec9..972dedb22a 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -176,7 +176,7 @@ public class IoTDBConfig {
 
   // region Write Ahead Log Configuration
   /** Write mode of wal */
-  private volatile WALMode walMode = WALMode.ASYNC;
+  private volatile WALMode walMode = WALMode.DISABLE;
 
   /** Max number of wal nodes, each node corresponds to one wal directory */
   private int maxWalNodesNum = 0;
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 17be5981cb..e5aa77d06b 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
@@ -644,6 +644,7 @@ public class StorageEngineV2 implements IService {
     DataRegion region =
         deletingDataRegionMap.computeIfAbsent(regionId, k -> dataRegionMap.remove(regionId));
     if (region != null) {
+      region.markDeleted();
       try {
         region.abortCompaction();
         region.syncDeleteDataFiles();
@@ -665,7 +666,6 @@ public class StorageEngineV2 implements IService {
             e);
       } finally {
         deletingDataRegionMap.remove(regionId);
-        region.markDeleted();
       }
     }
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index 80d38b4ca1..d8d5cc4a43 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -883,6 +883,9 @@ public class DataRegion {
     }
     writeLock("InsertRow");
     try {
+      if (deleted) {
+        return;
+      }
       // init map
       long timePartitionId = StorageEngineV2.getTimePartition(insertRowNode.getTime());
 
@@ -3057,6 +3060,9 @@ public class DataRegion {
     }
     writeLock("InsertRowsOfOneDevice");
     try {
+      if (deleted) {
+        return;
+      }
       boolean isSequence = false;
       for (int i = 0; i < insertRowsOfOneDeviceNode.getInsertRowNodeList().size(); i++) {
         InsertRowNode insertRowNode = insertRowsOfOneDeviceNode.getInsertRowNodeList().get(i);