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

jt2594838 pushed a commit to branch add_measurement_cache
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4b4021e97df46b36534ec96722bae919e996b1fb
Author: Tian Jiang <[email protected]>
AuthorDate: Tue Jun 9 17:40:00 2026 +0800

    Add a log when resource is missing in snapshot
---
 .../db/storageengine/dataregion/snapshot/SnapshotLoader.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotLoader.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotLoader.java
index c32f2301289..e36df77eef5 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotLoader.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotLoader.java
@@ -28,7 +28,9 @@ import org.apache.iotdb.db.i18n.StorageEngineMessages;
 import org.apache.iotdb.db.storageengine.StorageEngine;
 import org.apache.iotdb.db.storageengine.dataregion.DataRegion;
 import org.apache.iotdb.db.storageengine.dataregion.flush.CompressionRatio;
+import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 
+import org.apache.tsfile.common.constant.TsFileConstant;
 import org.apache.tsfile.external.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -355,6 +357,8 @@ public class SnapshotLoader {
       String targetSuffix, File[] files, FolderManager folderManager) throws 
IOException {
     Map<String, String> fileTarget = new HashMap<>();
     for (File file : files) {
+      checkTsFileResourceExists(file);
+
       String fileKey = file.getName().split("\\.")[0];
       String dataDir = fileTarget.get(fileKey);
 
@@ -388,6 +392,14 @@ public class SnapshotLoader {
     }
   }
 
+  private void checkTsFileResourceExists(File file) throws IOException {
+    if (!file.getName().endsWith(TsFileConstant.TSFILE_SUFFIX)) {
+      return;
+    }
+
+    LOGGER.warn("The associated resource file of {} is not found in the 
snapshot", file);
+  }
+
   private void createLinksFromSnapshotDirToDataDirWithLog() throws IOException 
{
     String snapshotId = logAnalyzer.getSnapshotId();
     int loggedFileNum = logAnalyzer.getTotalFileCountInSnapshot();

Reply via email to