jolshan commented on code in PR #13499:
URL: https://github.com/apache/kafka/pull/13499#discussion_r1158727282


##########
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:
   Makes sense to me. Thanks. Just wanted to make sure we couldn't transition 
to another state (in the current code) and we would hit this error.



-- 
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

Reply via email to