private void resetIdempotentProducerId() {
        if (isTransactional())
            throw new IllegalStateException("Cannot reset producer state for a transactional producer. " +
                    "You must either abort the ongoing transaction or reinitialize the transactional producer instead");
        log.debug("Resetting idempotent producer ID. ID and epoch before reset are {}", this.producerIdAndEpoch);
        setProducerIdAndEpoch(ProducerIdAndEpoch.NONE);
        transitionTo(State.UNINITIALIZED);
    }
This method resets the producer ID and epoch and sets the state to UNINITIALIZED, which will trigger a new
InitProducerId request. This method is only called when the producer epoch is exhausted; we will bump the epoch
instead.
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java