jolshan commented on code in PR #13499: URL: https://github.com/apache/kafka/pull/13499#discussion_r1158721755
########## 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: To confirm -- the issue only arises when we transition to Dead + try to expire? We won't see any other transitions until the epoch is written correctly? -- 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