private static boolean handleWhenSomeSourceFilesLost(
      List<TsFileResource> targetResourceList,
      List<TsFileResource> sourceSeqResourceList,
      List<TsFileResource> sourceUnseqResourceList,
      List<TsFileResource> lostSourceResourceList,
      String fullStorageGroupName)
      throws IOException {
    // check whether is all target files complete
    if (!checkIsTargetFilesComplete(
        targetResourceList, lostSourceResourceList, fullStorageGroupName)) {
      return false;
    }

    // delete sources file
    CompactionUtils.deleteSourceTsFileAndUpdateFileMetrics(
        sourceSeqResourceList, sourceUnseqResourceList);
    // delete compaction mods files
    CompactionUtils.deleteCompactionModsFile(sourceSeqResourceList, sourceUnseqResourceList);

    return true;
  }
Some source files are lost, check if all target files are complete. If all target files are
complete, delete the remaining source files and compaction mods files. If some target files are
not complete, print some error logs.

@throws IOException if the io operations on file fails
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/exception/CompactionExceptionHandler.java