artemlivshits commented on code in PR #21735:
URL: https://github.com/apache/kafka/pull/21735#discussion_r4560513678


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -561,7 +606,10 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
           val coordinatorEpoch = epochAndTxnMetadata.coordinatorEpoch
 
           txnMetadata.inLock(() => {
-            if (txnMetadata.producerId != producerId)
+            // A transaction kept with InitProducerId(keepPreparedTxn=true) 
can only be completed with TV2.
+            if (txnMetadata.hasNextProducerEpoch)

Review Comment:
   Yes, in principle, though it should be highly unlikely: the client that kept 
the transaction uses TV2, so only a stale EndTxn from a zombie instance using 
TV1 could hit it (a stale TV2 EndTxn would get PRODUCER_FENCED from the epoch 
check). No harm in changing it for consistency, so it returns PRODUCER_FENCED 
now, done in df7605ac96.



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