public void truncateOldEntries(long startOffset) {
        synchronized (voterSetHistory) {
            voterSetHistory.truncateOldEntries(startOffset);
        }
        synchronized (kraftVersionHistory) {
            kraftVersionHistory.truncateOldEntries(startOffset);
        }
    }
Remove the tail of the log until the given offset.

@param startOffset the start offset (inclusive)
raft/src/main/java/org/apache/kafka/raft/internals/KRaftControlRecordStateMachine.java