public long getFirstValidWALVersionId() {
    List<MemTableInfo> memTableInfos = activeOrPinnedMemTables();
    long firstValidVersionId = memTableInfos.isEmpty() ? Long.MIN_VALUE : Long.MAX_VALUE;
    for (MemTableInfo memTableInfo : memTableInfos) {
      firstValidVersionId = Math.min(firstValidVersionId, memTableInfo.getFirstFileVersionId());
    }
    return firstValidVersionId;
  }
Get version id of first valid .wal file

@return Return {@link Long#MIN_VALUE} if no file is valid
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/checkpoint/CheckpointManager.java