private boolean isFileProgressCoveredByGivenProgress(
      String fileName, ProgressIndex currentProgressIndex) {
    if (currentProgressIndex instanceof SimpleProgressIndex) {
      SimpleProgressIndex simpleProgressIndex = (SimpleProgressIndex) currentProgressIndex;
      int curRebootTimes = simpleProgressIndex.getRebootTimes();
      long curMemTableFlushOrderId = simpleProgressIndex.getMemTableFlushOrderId();

      Pattern pattern = Pattern.compile(DELETION_FILE_NAME_PATTERN);
      Matcher matcher = pattern.matcher(fileName);
      // Definitely match. Because upper caller has filtered fileNames.
      if (matcher.matches()) {
        int fileRebootTimes = Integer.parseInt(matcher.group(REBOOT_TIME));
        long fileMemTableFlushOrderId = Long.parseLong(matcher.group(MEM_TABLE_FLUSH_ORDER));
        return fileRebootTimes == curRebootTimes
            ? fileMemTableFlushOrderId <= curMemTableFlushOrderId
            : fileRebootTimes < curRebootTimes;
      }
    }
    return false;
  }
This is a hook function, which will be automatically invoked when deletionResource's reference
count returns to 0.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java