From 3244255e940d7aea7ea86d55ac78716682f1c685 Mon Sep 17 00:00:00 2001 From: Haonan Date: Tue, 7 Nov 2023 10:02:51 +0800 Subject: [PATCH] fix empty resource recovered from wal (#11452) --- .../apache/iotdb/db/storageengine/dataregion/DataRegion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java index 3d63bc658ba6..024f5dfd2adf 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java @@ -730,6 +730,10 @@ private void recoverUnsealedTsFileCallBack(UnsealedTsFileRecoverPerformer recove } catch (IOException e) { logger.error("Fail to close TsFile {} when recovering", tsFileResource.getTsFile(), e); } + if (!TsFileValidator.getInstance().validateTsFile(tsFileResource)) { + tsFileResource.remove(); + return; + } updateLastFlushTime(tsFileResource, isSeq); tsFileResourceManager.registerSealedTsFileResource(tsFileResource); FileMetrics.getInstance()