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

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


The following commit(s) were added to refs/heads/fast_write_test_with_guoneng 
by this push:
     new 3888ec6dea fix wal iterator
3888ec6dea is described below

commit 3888ec6deae645c1a366f0c78995bd35ac77cc8c
Author: HeimingZ <[email protected]>
AuthorDate: Wed Apr 26 12:43:50 2023 +0800

    fix wal iterator
---
 .../java/org/apache/iotdb/db/wal/node/WALNode.java | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 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 af373e6960..283c4fdd2c 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
@@ -674,22 +674,16 @@ public class WALNode implements IWALNode {
 
     @Override
     public void waitForNextReady() throws InterruptedException {
-      boolean walFileRolled = false;
       while (!hasNext()) {
-        if (!walFileRolled) {
-          boolean timeout =
-              !buffer.waitForFlush(WAIT_FOR_NEXT_WAL_ENTRY_TIMEOUT_IN_SEC, 
TimeUnit.SECONDS);
-          if (timeout) {
-            logger.info(
-                "timeout when waiting for next WAL entry ready, execute 
rollWALFile. Current search index in wal buffer is {}, and next target index is 
{}",
-                buffer.getCurrentSearchIndex(),
-                nextSearchIndex);
-            rollWALFile();
-            walFileRolled = true;
-          }
-        } else {
-          buffer.waitForFlush();
+        boolean timeout =
+            !buffer.waitForFlush(WAIT_FOR_NEXT_WAL_ENTRY_TIMEOUT_IN_SEC, 
TimeUnit.SECONDS);
+        if (timeout) {
+          logger.info(
+              "timeout when waiting for next WAL entry ready. Current search 
index in wal buffer is {}, and next target index is {}",
+              buffer.getCurrentSearchIndex(),
+              nextSearchIndex);
         }
+        rollWALFile();
       }
     }
 

Reply via email to