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


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionMetadata.scala:
##########
@@ -487,15 +519,22 @@ private[transaction] class TransactionMetadata(val 
transactionalId: String,
       }
 
       debug(s"TransactionalId $transactionalId complete transition from $state 
to $transitMetadata")
+      clientTransactionVersion = transitMetadata.clientTransactionVersion
       txnLastUpdateTimestamp = transitMetadata.txnLastUpdateTimestamp
       pendingState = None
       state = toState
     }
   }
 
   private def validProducerEpoch(transitMetadata: TxnTransitMetadata): Boolean 
= {
-    val transitEpoch = transitMetadata.producerEpoch
-    val transitProducerId = transitMetadata.producerId
+    val isAtLeastTransactionsV2 = transitMetadata.clientTransactionVersion >= 2

Review Comment:
   Want to refactor or at least make this code clearer



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