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 2020/01/03 08:10:54 UTC

[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #700: Continue writing the last unclosed file

qiaojialin commented on a change in pull request #700: Continue writing the last unclosed file
URL: https://github.com/apache/incubator-iotdb/pull/700#discussion_r362729416
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
 ##########
 @@ -287,24 +288,42 @@ private void continueFailedRenames(File fileFolder, String suffix) {
   }
 
   private void recoverSeqFiles(List<TsFileResource> tsFiles) throws StorageGroupProcessorException {
-    for (TsFileResource tsFileResource : tsFiles) {
+    for (int i = 0; i < tsFiles.size(); i++) {
+      TsFileResource tsFileResource = tsFiles.get(i);
       sequenceFileList.add(tsFileResource);
       TsFileRecoverPerformer recoverPerformer = new TsFileRecoverPerformer(storageGroupName + "-"
-          , schema, versionController, tsFileResource, false);
-      recoverPerformer.recover();
-      tsFileResource.setClosed(true);
+          , schema, versionController, tsFileResource, false, i == tsFiles.size() - 1);
+      RestorableTsFileIOWriter writer = recoverPerformer.recover();
+      if (i != tsFiles.size() - 1) {
 
 Review comment:
   We could have more than one unclosed TsFiles in a SG

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services