public int producerIdCount() {
        return producerIdCount;
    }
This method checks whether there is a late transaction in a thread safe manner.
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateManager.java