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

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


The following commit(s) were added to 
refs/heads/fix_insertion_compaction_with_deletion by this push:
     new 013377a7f63 Fix the missing deletion when concurrent deletion and 
insertion compaction
013377a7f63 is described below

commit 013377a7f63851a38b142ecc73e5ba1e2bf6d9cb
Author: jt2594838 <[email protected]>
AuthorDate: Wed Feb 26 11:05:43 2025 +0800

    Fix the missing deletion when concurrent deletion and insertion compaction
---
 .../iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
index 02b9ee2c92a..1f46fa53211 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
@@ -399,16 +399,22 @@ public class TsFileResource implements PersistentResource 
{
     sourceModFile.writeLock();
     try {
       if (sourceModFile.exists()) {
+        LOGGER.error(
+            "Linking existing modification file {} to file {}", sourceModFile, 
targetModsFile);
         Files.createLink(
             targetModsFile.toPath(), 
ModificationFile.getExclusiveMods(getTsFile()).toPath());
         targetModsFileObject = new ModificationFile(targetModsFile, true);
+        
sourceModFile.setCascadeFile(Collections.singleton(targetModsFileObject));
       } else {
+        LOGGER.error(
+            "Linking non-existing modification file {} to file {}", 
sourceModFile, targetModsFile);
         targetModsFileObject = new ModificationFile(targetModsFile, true);
         
sourceModFile.setCascadeFile(Collections.singleton(targetModsFileObject));
       }
     } finally {
       sourceModFile.writeUnlock();
     }
+    LOGGER.error("Set modification file {}", targetModsFile);
     target.setExclusiveModFile(targetModsFileObject);
     if (sharedModFileExists()) {
       modFileManagement.addReference(target, sharedModFile);

Reply via email to