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 49fd2eb1feb Flush previous time partition memtable by wal (#10221) 
(#10235)
49fd2eb1feb is described below

commit 49fd2eb1febb88681e0b8ae5d706b83551ae74ff
Author: Jialin Qiao <[email protected]>
AuthorDate: Tue Jun 20 13:57:57 2023 +0800

    Flush previous time partition memtable by wal (#10221) (#10235)
    
    Co-authored-by: Haonan <[email protected]>
---
 server/src/main/java/org/apache/iotdb/db/wal/WALManager.java |  2 +-
 .../src/main/java/org/apache/iotdb/db/wal/node/WALNode.java  | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java 
b/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
index 36db197dae5..d041114fde9 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
@@ -202,7 +202,7 @@ public class WALManager implements IService {
   }
 
   public boolean shouldThrottle() {
-    return getTotalDiskUsage() >= config.getThrottleThreshold();
+    return getTotalDiskUsage() >= config.getThrottleThreshold() * 0.8;
   }
 
   public long getTotalDiskUsage() {
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 4891062e892..8a040a980f1 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
@@ -240,13 +240,7 @@ public class WALNode implements IWALNode {
           identifier,
           firstValidVersionId,
           safelyDeletedSearchIndex);
-      boolean pinnedByIoTConsensus = deleteOutdatedFiles();
-      if (pinnedByIoTConsensus) {
-        logger.debug(
-            "Cannot delete wal files for wal node-{} because of wal files are 
pinned by IoTConsensus.",
-            identifier);
-        return;
-      }
+      deleteOutdatedFiles();
 
       // calculate effective information ratio
       long costOfActiveMemTables = 
checkpointManager.getTotalCostOfActiveMemTables();
@@ -277,6 +271,10 @@ public class WALNode implements IWALNode {
           config.getWalMinEffectiveInfoRatio());
       boolean isSuccess = snapshotOrFlushMemTable();
       if (isSuccess && recursionTime < MAX_RECURSION_TIME) {
+        // wal is used to search, cannot optimize files deletion
+        if (safelyDeletedSearchIndex != DEFAULT_SAFELY_DELETED_SEARCH_INDEX) {
+          return;
+        }
         recursionTime++;
         run();
       }

Reply via email to