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

xingtanzjr 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 155c181ad6e fix (#10993)
155c181ad6e is described below

commit 155c181ad6e26d59cd9e2da580e59f0cf782cbce
Author: Zhijia Cao <[email protected]>
AuthorDate: Thu Aug 31 11:08:03 2023 +0800

    fix (#10993)
---
 .../iotdb/db/storageengine/dataregion/wal/node/WALNode.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WALNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WALNode.java
index da17957750e..8ee08e09156 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WALNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/node/WALNode.java
@@ -267,7 +267,10 @@ public class WALNode implements IWALNode {
     public void run() {
       // The intent of the loop execution here is to try to get as many 
memTable flush or snapshot
       // as possible when the valid information ratio is less than the 
configured value.
-      while (recursionTime < MAX_RECURSION_TIME) {
+      // In addition, if the disk space used by wal exceeds the limit 
threshold, resulting in a
+      // write rejection, the task will continue to attempt to delete expired 
files until the
+      // threshold is no longer exceeded
+      while (recursionTime < MAX_RECURSION_TIME || 
WALManager.getInstance().shouldThrottle()) {
         // init delete outdated file task fields
         init();
 
@@ -282,8 +285,9 @@ public class WALNode implements IWALNode {
 
         // decide whether to snapshot or flush based on the effective info 
ration and throttle
         // threshold
-        if (!snapshotOrFlushMemTable()
-            && safelyDeletedSearchIndex != 
DEFAULT_SAFELY_DELETED_SEARCH_INDEX) {
+        if (trySnapshotOrFlushMemTable()
+            && safelyDeletedSearchIndex != DEFAULT_SAFELY_DELETED_SEARCH_INDEX
+            && !WALManager.getInstance().shouldThrottle()) {
           return;
         }
         recursionTime++;
@@ -427,7 +431,7 @@ public class WALNode implements IWALNode {
      *
      * @return true if snapshot or flush is executed successfully
      */
-    private boolean snapshotOrFlushMemTable() {
+    private boolean trySnapshotOrFlushMemTable() {
       if (!shouldSnapshotOrFlush()) {
         return false;
       }

Reply via email to