protected void reconstructResourceFile() throws IOException {
    try (TsFileSequenceReader reader =
        new TsFileSequenceReader(tsFileResource.getTsFile().getAbsolutePath())) {
      TsFileResourceUtils.updateTsFileResource(reader, tsFileResource, false);
    }

    // set progress index for pipe to avoid data loss
    PipeDataNodeAgent.runtime().assignProgressIndexForTsFileRecovery(tsFileResource);

    tsFileResource.serialize();
  }
Recover TsFile with RestorableTsFileIOWriter, including load .resource file (reconstruct when
necessary) and truncate the file to remaining corrected data. <br>
Notice: this method may open a {@link RestorableTsFileIOWriter}, remember to close it.

@throws DataRegionException when failing to new RestorableTsFileIOWriter.
@throws IOException when failing to read .resource file.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/AbstractTsFileRecoverPerformer.java