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


##########
core/src/main/scala/kafka/server/AddPartitionsToTxnManager.scala:
##########
@@ -67,10 +67,14 @@ object AddPartitionsToTxnManager {
  *    genericErrorSupported: This maps to the case when the clients are 
updated to handle the TransactionAbortableException
  *    addPartition:          This allows the partition to be added to the 
transactions inflight with the Produce and TxnOffsetCommit requests. Plus the 
behaviors in genericErrorSupported.
  */
-sealed trait TransactionSupportedOperation
+sealed trait TransactionSupportedOperation {
+  val isTV2 = false;

Review Comment:
   Nit: do we need a semicolon here?



##########
core/src/main/scala/kafka/server/AddPartitionsToTxnManager.scala:
##########
@@ -67,10 +67,14 @@ object AddPartitionsToTxnManager {
  *    genericErrorSupported: This maps to the case when the clients are 
updated to handle the TransactionAbortableException
  *    addPartition:          This allows the partition to be added to the 
transactions inflight with the Produce and TxnOffsetCommit requests. Plus the 
behaviors in genericErrorSupported.
  */
-sealed trait TransactionSupportedOperation
+sealed trait TransactionSupportedOperation {
+  val isTV2 = false;

Review Comment:
   Should we name it `atLeastTV2` (if we have more protocol bumps they will 
inherit this override), or maybe `supportsEpochBump` to be consistent with TC 
naming (which tries to express the same thing).



##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -950,7 +958,7 @@ class ReplicaManager(val config: KafkaConfig,
   ): Unit = {
     // Skip verification if the request is not transactional or transaction 
verification is disabled.
     if (transactionalId == null ||
-      !config.transactionLogConfig.transactionPartitionVerificationEnable
+      (!config.transactionLogConfig.transactionPartitionVerificationEnable && 
transactionSupportedOperation != addPartition)

Review Comment:
   Should we use `transactionSupportedOperation.isTV2` here?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to