public synchronized void removeTsFileResource(TsFileResource tsFileResource) {
    if (sealedTsFileResources.contains(tsFileResource)) {
      sealedTsFileResources.remove(tsFileResource);
      if (TimeIndexLevel.valueOf(tsFileResource.getTimeIndexType())
          == TimeIndexLevel.FILE_TIME_INDEX) {
        memoryBlock.release(tsFileResource.calculateRamSize());
        degradedTimeIndexNum--;
      } else {
        memoryBlock.release(tsFileResource.calculateRamSize());
      }
    }
  }
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