dajac commented on code in PR #13499: URL: https://github.com/apache/kafka/pull/13499#discussion_r1158725694
########## core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala: ########## @@ -382,7 +382,10 @@ private[transaction] class TransactionMetadata(val transactionalId: String, if (newProducerId < 0) throw new IllegalArgumentException(s"Illegal new producer id $newProducerId") - if (newEpoch < 0) + // The epoch is initialized to NO_PRODUCER_EPOCH when the TransactionMetadata + // is created for the first time and it could stay like this until transitioning + // to Dead. + if (newState != Dead && newEpoch < 0) Review Comment: Right. We basically transitions from Empty (without a producer epoch) to Dead. My thinking is that we should basically always accept to transition to Dead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org