jeffkbkim commented on code in PR #18730:
URL: https://github.com/apache/kafka/pull/18730#discussion_r1936161525


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -408,13 +408,16 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
 
           // generate the new transaction metadata with added partitions
           txnMetadata.inLock {
-            if (txnMetadata.producerId != producerId) {
+            if (txnMetadata.pendingTransitionInProgress) {
+              // return a retriable exception to let the client backoff and 
retry
+              // This check is performed first so that the pending transition 
can complete before subsequent checks.
+              // With TV2, we may be transitioning over a producer epoch 
overflow, and the producer may be using the
+              // new producer ID that is still only in pending state.

Review Comment:
   To understand: L419 will return producer_fenced which for epoch overflow 
which we don't want. Hence, we moved the pending state check here and we are 
applying this logic in both addPartitionsToTxn and endTransaction phases. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to