diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/BatchCompactionPlan.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/BatchCompactionPlan.java index 3b30e798227b..53e25da2b60c 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/BatchCompactionPlan.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/batch/utils/BatchCompactionPlan.java @@ -51,7 +51,7 @@ public Chunk getTimeChunkFromCache(TsFileSequenceReader reader, ChunkMetadata ch if (chunk == null) { chunk = reader.readMemChunk(chunkMetadata); } - chunk.getData().flip(); + chunk.getData().reset(); return chunk; } @@ -59,6 +59,7 @@ public void addTimeChunkToCache(String file, long offset, Chunk chunk) { if (cachedTimeChunkSize >= MAX_CACHED_TIME_CHUNKS_SIZE) { return; } + chunk.getData().mark(); cachedTimeChunks.put( new Pair<>(file, offset), new Chunk(