private void checkCapacity(CapacityReader reader) throws IOException {
        if (null == reader) {
            return;
        }
        Long capacity = reader.capacity(this);
        if (null == capacity) {
            if (recoveryMode) {
                throw new WALNotInitializedException("try to open an uninitialized WAL in recovery mode: empty header. path: " + filePath);
            }
        } else if (fileCapacityFact != capacity) {
            throw new WALCapacityMismatchException(filePath, fileCapacityFact, capacity);
        }
        assert fileCapacityFact != CAPACITY_NOT_SET;
    }
When set to true, the file should exist and the file size does not need to be verified.
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALFileChannel.java