JackieTien97 commented on a change in pull request #4538:
URL: https://github.com/apache/iotdb/pull/4538#discussion_r765385406



##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -664,15 +665,15 @@ private void recoverTsFiles(List<TsFileResource> tsFiles, 
boolean isSeq) throws
                   + FILE_NAME_SEPARATOR,
               tsFileResource,
               isSeq,
-              i == tsFiles.size() - 1);
+              needsCheckTsFile);
 
       RestorableTsFileIOWriter writer = null;
       try {
         // this tsfile is not zero level, no need to perform redo wal
         if (TsFileResource.getMergeLevel(tsFileResource.getTsFile().getName()) 
> 0) {
           writer =
               recoverPerformer.recover(false, this::getWalDirectByteBuffer, 
this::releaseWalBuffer);
-          if (writer.hasCrashed()) {
+          if (writer != null && writer.hasCrashed()) {

Review comment:
       In merge task, even if the tsfileresource is complete, the tsfile may 
not finish ending.




-- 
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