public void forceDegradeTsFileResource(TsFileResource resource) {
    if (TimeIndexLevel.valueOf(resource.getTimeIndexType()) == TimeIndexLevel.FILE_TIME_INDEX) {
      return;
    }
    logger.debug("Force degrade tsfile resource {}", resource.getTsFilePath());
    synchronized (this) {
      if (!sealedTsFileResources.remove(resource)) {
        resource.degradeTimeIndex();
        return;
      }
      long memoryReduce = resource.degradeTimeIndex();
      degradedTimeIndexNum++;
      releaseTimeIndexMemCost(memoryReduce);
      sealedTsFileResources.add(resource);
    }
  }
delete the TsFileResource in PriorityQueue when the source file is deleted
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/memory/TsFileResourceManager.java