You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/02/24 10:12:14 UTC

[GitHub] [iotdb] choubenson commented on a change in pull request #5113: [To rel/0.12][IOTDB-2603]Fix compaction recover

choubenson commented on a change in pull request #5113:
URL: https://github.com/apache/iotdb/pull/5113#discussion_r813732026



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/merge/task/RecoverMergeTask.java
##########
@@ -80,7 +95,57 @@ public void recoverMerge() throws IOException, MetadataException {
     }
   }
 
-  private void resumeAfterFilesLogged() throws IOException {
+  private void handleWhenAllSourceFilesExist() throws IOException {
     cleanUp(false);
+    appendNewModificationToOldModsFile(resource.getSeqFiles());
+    appendNewModificationToOldModsFile(resource.getUnseqFiles());
+    tsFileManagement.removeMergingModification();
+  }
+
+  private void handleWhenSomeSourceFilesLost() throws IOException {
+    for (TsFileResource sourceSeqResource : resource.getSeqFiles()) {
+      File targetFile = modifyTsFileNameUnseqMergCnt(sourceSeqResource.getTsFile());
+      File targetFileResource = new File(targetFile.getPath() + TsFileResource.RESOURCE_SUFFIX);
+      File tmpTargetFile = new File(sourceSeqResource.getTsFilePath() + MERGE_SUFFIX);
+      // move to target file and target resource file
+      if (!targetFileResource.exists()) {
+        if (!targetFile.exists()) {
+          // move target file
+          FSFactoryProducer.getFSFactory().moveFile(tmpTargetFile, targetFile);
+        }
+        // move target resource file
+        FSFactoryProducer.getFSFactory()

Review comment:
       resolved

##########
File path: server/src/assembly/resources/conf/iotdb-engine.properties
##########
@@ -451,11 +451,6 @@ timestamp_precision=ms
 # If you are feeling the rebooting is too slow, set this to false, false by default
 # continue_merge_after_reboot=false
 
-# When set to true, all unseq merges becomes full merge (the whole SeqFiles are re-written despite how
-# much they are overflowed). This may increase merge overhead depending on how much the SeqFiles
-# are overflowed.
-# force_full_merge=true
-

Review comment:
       resolved




-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org