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

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


The following commit(s) were added to refs/heads/rel/0.10 by this push:
     new 83a0d1b  fix cannot set version when recover the uncompleted files 
(#1347)
83a0d1b is described below

commit 83a0d1b6700fead995eacd070dab371c950a9483
Author: Haonan <[email protected]>
AuthorDate: Thu Jun 11 15:12:55 2020 +0800

    fix cannot set version when recover the uncompleted files (#1347)
---
 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);
     }
   }

Reply via email to