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


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -540,24 +572,29 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
                   txnMetadata.lastProducerEpoch = RecordBatch.NO_PRODUCER_EPOCH
                 }
 
-                Right(coordinatorEpoch, 
txnMetadata.prepareAbortOrCommit(nextState, time.milliseconds()))
+                nextProducerIdOrErrors match {
+                  case Left(error) =>
+                    Left(error)
+                  case Right(nextProducerId) =>
+                    Right(coordinatorEpoch, 
txnMetadata.prepareAbortOrCommit(nextState, clientTransactionVersion, 
nextProducerId, time.milliseconds()))
+                }
               case CompleteCommit =>

Review Comment:
   Originally I put the retry check above the epoch check since I thought it 
would be easier to do that first and not touch the check for the same epoch. 
The tricky thing is specifically that if we hit this code we have the same 
epoch which is wrong. (In other words, we should have the same OR a different 
epoch depending on the state -- but I can factor that all in the epoch check, 
it just means we will check the state in two places.)



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