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

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

commit d451236f7f68b0c3c4542cb160d6762542c0f3f8
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Wed Aug 10 19:29:22 2022 +0800

    fix the issue that the last entry cannot be fetched from WAL
---
 server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 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 a77753976c..c38fd77b06 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
@@ -680,9 +680,11 @@ public class WALNode implements IWALNode {
     @Override
     public void waitForNextReady() throws InterruptedException {
       while (!hasNext()) {
-        buffer.waitForFlush(30, TimeUnit.SECONDS);
-        logger.info("wait for next ready timeout, execute roll");
-        rollWALFile();
+        boolean timeout = !buffer.waitForFlush(30, TimeUnit.SECONDS);
+        if (timeout) {
+          logger.info("timeout when waiting for next WAL entry ready, execute 
rollWALFile");
+          rollWALFile();
+        }
       }
     }
 

Reply via email to