You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xu...@apache.org on 2020/11/19 01:49:42 UTC

[iotdb] branch fix_file_version_bug created (now b7d0fc2)

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

xuekaifeng pushed a change to branch fix_file_version_bug
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at b7d0fc2  fix bug

This branch includes the following new commits:

     new b7d0fc2  fix bug

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: fix bug

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b7d0fc29e7c1bc5eb66acaf36df233ccef0c02c1
Author: 151250176 <15...@smail.nju.edu.cn>
AuthorDate: Thu Nov 19 09:49:24 2020 +0800

    fix bug
---
 .../apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java    | 4 ++--
 .../java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
index 919fcee..22ddad1 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
@@ -1025,7 +1025,7 @@ public class StorageGroupProcessor {
       tsFileProcessor = new TsFileProcessor(storageGroupName,
           fsFactory.getFileWithParent(filePath), storageGroupInfo,
           versionController, this::closeUnsealedTsFileProcessorCallBack,
-          this::updateLatestFlushTimeCallback, true);
+          this::updateLatestFlushTimeCallback, true, partitionMaxFileVersions.getOrDefault(timePartitionId, 0L));
       if (enableMemControl) {
         TsFileProcessorInfo tsFileProcessorInfo = new TsFileProcessorInfo(storageGroupInfo);
         tsFileProcessor.setTsFileProcessorInfo(tsFileProcessorInfo);
@@ -1037,7 +1037,7 @@ public class StorageGroupProcessor {
       tsFileProcessor = new TsFileProcessor(storageGroupName,
           fsFactory.getFileWithParent(filePath), storageGroupInfo,
           versionController, this::closeUnsealedTsFileProcessorCallBack,
-          this::unsequenceFlushCallback, false);
+          this::unsequenceFlushCallback, false, partitionMaxFileVersions.getOrDefault(timePartitionId, 0L));
       if (enableMemControl) {
         TsFileProcessorInfo tsFileProcessorInfo = new TsFileProcessorInfo(storageGroupInfo);
         tsFileProcessor.setTsFileProcessorInfo(tsFileProcessorInfo);
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index b810774..1007948 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -129,7 +129,7 @@ public class TsFileProcessor {
       StorageGroupInfo storageGroupInfo,
       VersionController versionController,
       CloseFileListener closeTsFileCallback,
-      UpdateEndTimeCallBack updateLatestFlushTimeCallback, boolean sequence)
+      UpdateEndTimeCallBack updateLatestFlushTimeCallback, boolean sequence, long fileVersion)
       throws IOException {
     this.storageGroupName = storageGroupName;
     this.tsFileResource = new TsFileResource(tsfile, this);
@@ -143,7 +143,7 @@ public class TsFileProcessor {
     logger.info("create a new tsfile processor {}", tsfile.getAbsolutePath());
     // a file generated by flush has only one historical version, which is itself
     this.tsFileResource
-        .setHistoricalVersions(Collections.singleton(versionController.currVersion()));
+        .setHistoricalVersions(Collections.singleton(fileVersion));
     flushListeners.add(new WALFlushListener(this));
     closeFileListeners.add(closeTsFileCallback);
   }