This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch fix_inplace_compaction_load in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a8cb5ad116c1f40576a3b49e628cca879288a4e7 Author: HTHou <[email protected]> AuthorDate: Tue Oct 24 20:09:11 2023 +0800 Skip loading Chunk without matched ChunkMetadata --- .../apache/iotdb/db/queryengine/execution/load/TsFileSplitter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/TsFileSplitter.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/TsFileSplitter.java index 55c5bc0aa3a..a48df792e36 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/TsFileSplitter.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/load/TsFileSplitter.java @@ -113,6 +113,12 @@ public class TsFileSplitter { ((header.getChunkType() & TsFileConstant.TIME_COLUMN_MASK) == TsFileConstant.TIME_COLUMN_MASK); IChunkMetadata chunkMetadata = offset2ChunkMetadata.get(chunkOffset - Byte.BYTES); + // When loading TsFile with Chunk in data zone but no matched ChunkMetadata + // at the end of file, this Chunk needs to be skipped. + if (chunkMetadata == null) { + reader.readChunk(-1, header.getDataSize()); + break; + } TTimePartitionSlot timePartitionSlot = TimePartitionUtils.getTimePartitionSlot(chunkMetadata.getStartTime()); ChunkData chunkData =
