jolshan commented on code in PR #21735:
URL: https://github.com/apache/kafka/pull/21735#discussion_r4519192164
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -927,9 +987,14 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
if (epochAndMetadata.coordinatorEpoch == coordinatorEpoch) {
val txnMetadata = epochAndMetadata.transactionMetadata
txnMetadata.inLock(() => {
- if (txnMetadata.producerId != producerId)
+ // Note that if we did a few
InitProducerId(keepPreparedTxn) the client's producer id
+ // may be different from the producerId (we track it in
the nextProducerId), but at
+ // this point even nextProducerId could be different
from the client's producer id
+ // if we generated a new nextProducerId due to
nextProducerEpoch overflow. So we
+ // check with the copy of the txnMetadata.producerId.
Ditto for the epoch.
+ if (txnMetadata.producerId != producerIdCopy)
Review Comment:
Is this comment saying the check isn't required? I didn't quite understand.
--
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]