shuwenwei commented on code in PR #13878:
URL: https://github.com/apache/iotdb/pull/13878#discussion_r1843233814


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java:
##########
@@ -196,8 +197,27 @@ protected void 
setTargetFileForRecover(List<TsFileResource> resources) {
     }
   }
 
+  protected void prepareCompactionModFiles() throws IOException {
+    if (!TsFileResource.useSharedModFile) {
+      return;
+    }
+    TsFileResource firstSource = filesView.sourceFilesInLog.get(0);
+    TsFileResource firstTarget = filesView.targetFilesInPerformer.get(0);
+    ModFileManagement modFileManagement = firstSource.getModFileManagement();
+    ModificationFile modificationFile = 
modFileManagement.allocateFor(firstTarget);

Review Comment:
   If the shared mod file can not be found in the recovery and the compaction 
task will rollback in the system recovery(kill -9 before the target resource 
been serialized), at this point, the compaction recover task may not be able to 
locate this shared mods file.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java:
##########
@@ -196,8 +197,27 @@ protected void 
setTargetFileForRecover(List<TsFileResource> resources) {
     }
   }
 
+  protected void prepareCompactionModFiles() throws IOException {
+    if (!TsFileResource.useSharedModFile) {
+      return;
+    }
+    TsFileResource firstSource = filesView.sourceFilesInLog.get(0);
+    TsFileResource firstTarget = filesView.targetFilesInPerformer.get(0);
+    ModFileManagement modFileManagement = firstSource.getModFileManagement();
+    ModificationFile modificationFile = 
modFileManagement.allocateFor(firstTarget);

Review Comment:
   If the shared mod file can not be found in the recovery and the compaction 
task will rollback in the system recovery, at this point, the compaction 
recover task may not be able to locate this shared mods file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to