You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2020/06/11 03:57:53 UTC

[incubator-iotdb] branch jira-762-10 created (now b254b4c)

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

haonan pushed a change to branch jira-762-10
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at b254b4c  fix cannot set version when recover the uncompleted files

This branch includes the following new commits:

     new b254b4c  fix cannot set version when recover the uncompleted files

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.



[incubator-iotdb] 01/01: fix cannot set version when recover the uncompleted files

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

haonan pushed a commit to branch jira-762-10
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit b254b4c6d1b21e4cc98e4baa9dd35ac2b103be59
Author: HTHou <hh...@outlook.com>
AuthorDate: Thu Jun 11 11:56:41 2020 +0800

    fix cannot set version when recover the uncompleted files
---
 tsfile/src/main/java/org/apache/iotdb/tsfile/utils/VersionUtils.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/VersionUtils.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/VersionUtils.java
index bd31800..621c9c9 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/VersionUtils.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/utils/VersionUtils.java
@@ -36,6 +36,11 @@ public class VersionUtils {
       while (chunkMetadata.getOffsetOfChunkHeader() >= versionInfo.get(versionIndex).left) {
         versionIndex++;
       }
+      // When the TsFile is uncompleted, 
+      // skip the chunkMetadatas those don't have their version information
+      if (versionIndex >= versionInfo.size()) {
+        break;
+      }
       chunkMetadata.setVersion(versionInfo.get(versionIndex).right);
     }
   }