You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yu...@apache.org on 2020/07/29 02:09:43 UTC

[incubator-iotdb] branch kyy updated: flush before remove

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

yuyuankang pushed a commit to branch kyy
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/kyy by this push:
     new e499175  flush before remove
e499175 is described below

commit e499175fd84327d75af75c1ede84ee86b7c08fa9
Author: Ring-k <yu...@hotmail.com>
AuthorDate: Wed Jul 29 10:09:26 2020 +0800

    flush before remove
---
 .../iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
index d770e3d..b77b33d 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
@@ -495,6 +495,9 @@ public class SyncLogDequeSerializer implements StableEntryManager {
   }
 
   public void removeFirst(int num) {
+    if(bufferedLogNum > 0){
+      flushLogBuffer();
+    }
     firstLogPosition += num;
     for (int i = 0; i < num; i++) {
       removedLogSize += logSizeDeque.removeFirst();
@@ -678,6 +681,7 @@ public class SyncLogDequeSerializer implements StableEntryManager {
         logger.debug("Examining file for removal, file: {}, len: {}, removedLogSize: {}", logFile
             , logFile.length(), removedLogSize);
       }
+      long len = logFile.length();
       if (logFile.length() > removedLogSize) {
         break;
       }