This is an automated email from the ASF dual-hosted git repository. tanxinyu pushed a commit to branch wal_compression in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit d969e96b4146747dfdcdedce1c6d495abb278cad Author: OneSizeFitQuorum <[email protected]> AuthorDate: Wed Jul 3 15:39:37 2024 +0800 try fix Signed-off-by: OneSizeFitQuorum <[email protected]> --- .../iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java index 350f8f5e995..c86ca989389 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALInputStream.java @@ -222,6 +222,9 @@ public class WALInputStream extends InputStream implements AutoCloseable { if (Objects.isNull(compressedBuffer) || compressedBuffer.capacity() < segmentInfo.dataInDiskSize || compressedBuffer.capacity() > segmentInfo.dataInDiskSize * 2) { + if (!Objects.isNull(compressedBuffer)) { + MmapUtil.clean(compressedBuffer); + } compressedBuffer = ByteBuffer.allocateDirect(segmentInfo.dataInDiskSize); } compressedBuffer.clear(); @@ -233,7 +236,6 @@ public class WALInputStream extends InputStream implements AutoCloseable { compressedBuffer.flip(); IUnCompressor unCompressor = IUnCompressor.getUnCompressor(segmentInfo.compressionType); unCompressor.uncompress(compressedBuffer, dataBuffer); - MmapUtil.clean(compressedBuffer); } else { // An uncompressed segment if (Objects.isNull(dataBuffer)
