public long firstOrLastOffsetOfFirstBatch() {
        return firstOffset >= 0 ? firstOffset : lastOffsetOfFirstBatch;
    }
Get the first offset if it exists, else get the last offset of the first batch
For magic versions 2 and newer, this method will return first offset. For magic versions
older than 2, we use the last offset of the first batch as an approximation of the first
offset to avoid decompressing the data.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogAppendInfo.java