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


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -140,9 +141,12 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
       // 2PC functionality is disabled, clients that attempt to use this 
functionality
       // would receive an authorization failed error.
       
responseCallback(initTransactionError(Errors.TRANSACTIONAL_ID_AUTHORIZATION_FAILED))
-    } else if (keepPreparedTxn) {
-      // if the request is to keep the prepared transaction, then return an
-      // unsupported version error since the feature hasn't been implemented 
yet.
+    } else if (keepPreparedTxn && expectedProducerIdAndEpoch.nonEmpty) {
+      // keepPreparedTxn can only be specified in the initial call of 
InitProducerId, so
+      // no expected producerId / epoch should be set
+      responseCallback(initTransactionError(Errors.INVALID_REQUEST))
+    } else if (keepPreparedTxn && 
!txnManager.transactionVersionLevel().supportsEpochBump()) {

Review Comment:
   maybe tbd, but do we plan to gate any of this on tv3? Or is it just the apis?



##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -140,9 +141,12 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
       // 2PC functionality is disabled, clients that attempt to use this 
functionality
       // would receive an authorization failed error.
       
responseCallback(initTransactionError(Errors.TRANSACTIONAL_ID_AUTHORIZATION_FAILED))
-    } else if (keepPreparedTxn) {
-      // if the request is to keep the prepared transaction, then return an
-      // unsupported version error since the feature hasn't been implemented 
yet.
+    } else if (keepPreparedTxn && expectedProducerIdAndEpoch.nonEmpty) {
+      // keepPreparedTxn can only be specified in the initial call of 
InitProducerId, so
+      // no expected producerId / epoch should be set
+      responseCallback(initTransactionError(Errors.INVALID_REQUEST))
+    } else if (keepPreparedTxn && 
!txnManager.transactionVersionLevel().supportsEpochBump()) {

Review Comment:
   maybe tbd, but do we plan to gate any of this on tv3?



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