private void deleteVersionFiles(File[] versionFiles, int maxVersionIndex) {
    for (int i = 0; i < versionFiles.length; i++) {
      if (i != maxVersionIndex) {
        try {
          Files.delete(versionFiles[i].toPath());
        } catch (IOException e) {
          logger.error(
              "Delete outdated version file {} failed", versionFiles[i].getAbsolutePath(), e);
        }
      }
    }
  }
An index controller class to balance the performance degradation of frequent disk I/O.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/IndexController.java