public KRaftVersion kraftVersionAtOffset(long offset) {
        checkOffsetIsValid(offset);

        synchronized (kraftVersionHistory) {
            return kraftVersionHistory.valueAtOrBefore(offset).
                orElse(KRaftVersion.KRAFT_VERSION_0);
        }
    }
Returns the finalized kraft version at a given offset.

@param offset the offset (inclusive)
@return the finalized kraft version if one exist, otherwise 0
raft/src/main/java/org/apache/kafka/raft/internals/KRaftControlRecordStateMachine.java