You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/08/10 11:14:20 UTC

[iotdb] branch ml_0810_test updated: experiment wal roll when wait for next timeout

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


The following commit(s) were added to refs/heads/ml_0810_test by this push:
     new f467e61bd2 experiment wal roll when wait for next timeout
f467e61bd2 is described below

commit f467e61bd2a036c1785691c33643bae13b2b6640
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Wed Aug 10 19:14:08 2022 +0800

    experiment wal roll when wait for next timeout
---
 .../org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java | 1 -
 server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java        | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
index b0cfba2718..6ef1fab4ae 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
@@ -138,7 +138,6 @@ public class MultiLeaderServerImpl {
             thisNode.getGroupId(),
             indexedConsensusRequest.getSearchIndex(),
             result.getCode());
-        index.decrementAndGet();
       }
       return result;
     }
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 1a0a74de22..a77753976c 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,7 +680,9 @@ public class WALNode implements IWALNode {
     @Override
     public void waitForNextReady() throws InterruptedException {
       while (!hasNext()) {
-        buffer.waitForFlush();
+        buffer.waitForFlush(30, TimeUnit.SECONDS);
+        logger.info("wait for next ready timeout, execute roll");
+        rollWALFile();
       }
     }