You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2019/10/18 01:06:56 UTC

[incubator-iotdb] 01/01: add log

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

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

commit a75a5e546d646d2f51ed233ae88dac0435c289e9
Author: qiaojialin <64...@qq.com>
AuthorDate: Fri Oct 18 09:05:24 2019 +0800

    add log
---
 .../java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
index eec73e0..a8cb458 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
@@ -492,7 +492,7 @@ public class TsFileSequenceReader implements AutoCloseable {
     long endTimeOfChunk = 0;
     long numOfPoints = 0;
 
-    ChunkGroupMetaData currentChunkGroup;
+    ChunkGroupMetaData currentChunkGroup = null;
     List<ChunkMetaData> chunks = null;
     String deviceID;
     long startOffsetOfChunkGroup = 0;
@@ -587,7 +587,11 @@ public class TsFileSequenceReader implements AutoCloseable {
             ChunkGroupFooter chunkGroupFooter = this.readChunkGroupFooter();
             deviceID = chunkGroupFooter.getDeviceID();
             endOffsetOfChunkGroup = this.position();
-            currentChunkGroup = new ChunkGroupMetaData(deviceID, chunks, startOffsetOfChunkGroup);
+            try {
+              currentChunkGroup = new ChunkGroupMetaData(deviceID, chunks, startOffsetOfChunkGroup);
+            } catch (IllegalArgumentException e) {
+              logger.error("corrupted tsfile is {}", file);
+            }
             currentChunkGroup.setEndOffsetOfChunkGroup(endOffsetOfChunkGroup);
             currentChunkGroup.setVersion(versionOfChunkGroup++);
             newMetaData.add(currentChunkGroup);