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

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


The following commit(s) were added to refs/heads/object_type by this push:
     new 3619f4082ab fix ttl deletion
3619f4082ab is described below

commit 3619f4082ab8541ed256f320f5cb40fd5ab0a494
Author: shuwenwei <[email protected]>
AuthorDate: Mon Jul 14 15:15:14 2025 +0800

    fix ttl deletion
---
 .../apache/iotdb/db/storageengine/rescon/disk/TierManager.java | 10 ++++++++++
 .../main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java   |  9 +++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/disk/TierManager.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/disk/TierManager.java
index 61bb6ffafba..6355880cebd 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/disk/TierManager.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/disk/TierManager.java
@@ -254,11 +254,21 @@ public class TierManager {
   }
 
   public Optional<File> getAbsoluteObjectFilePath(String filePath) {
+    return getAbsoluteObjectFilePath(filePath, false);
+  }
+
+  public Optional<File> getAbsoluteObjectFilePath(String filePath, boolean 
needTempFile) {
     for (String objectDir : objectDirs) {
       File objectFile = FSFactoryProducer.getFSFactory().getFile(objectDir, 
filePath);
       if (objectFile.exists()) {
         return Optional.of(objectFile);
       }
+      if (needTempFile) {
+        if (new File(objectFile.getPath() + ".tmp").exists()
+            || new File(objectFile.getPath() + ".back").exists()) {
+          return Optional.of(objectFile);
+        }
+      }
     }
     return Optional.empty();
   }
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
index c66e3ffd05d..ba33a964228 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
@@ -50,20 +50,21 @@ public class ObjectTypeUtils {
     return file.get();
   }
 
-  public static Optional<File> getNullableObjectPathFromBinary(Binary binary) {
+  public static Optional<File> getNullableObjectPathFromBinary(
+      Binary binary, boolean needTempFile) {
     byte[] bytes = binary.getValues();
     String relativeObjectFilePath =
         new String(bytes, 8, bytes.length - 8, TSFileConfig.STRING_CHARSET);
-    return TIER_MANAGER.getAbsoluteObjectFilePath(relativeObjectFilePath);
+    return TIER_MANAGER.getAbsoluteObjectFilePath(relativeObjectFilePath, 
needTempFile);
   }
 
   public static void deleteObjectPathFromBinary(Binary binary) {
-    Optional<File> file = 
ObjectTypeUtils.getNullableObjectPathFromBinary(binary);
+    Optional<File> file = 
ObjectTypeUtils.getNullableObjectPathFromBinary(binary, true);
     if (!file.isPresent()) {
       return;
     }
     File tmpFile = new File(file.get().getPath() + ".tmp");
-    File bakFile = new File(file.get().getPath() + ".bak");
+    File bakFile = new File(file.get().getPath() + ".back");
     logger.info("Remove object file {}", file.get().getAbsolutePath());
     for (int i = 0; i < 2; i++) {
       try {

Reply via email to