public void syncDeleteOutdatedFilesInWALNodes() {
    if (config.getWalMode() == WALMode.DISABLE || walDeleteThread == null) {
      return;
    }
    Future<?> future = walDeleteThread.submit(this::deleteOutdatedFilesInWALNodes);
    try {
      future.get();
    } catch (ExecutionException e) {
      throw new StorageEngineFailureException("Failed to delete outdated wal file", e);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new StorageEngineFailureException("Failed to delete outdated wal file", e);
    }
  }
Wait until all write-ahead logs are flushed.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/WALManager.java