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


##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -442,6 +477,12 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
               // With TV2, we may be transitioning over a producer epoch 
overflow, and the producer may be using the
               // new producer ID that is still only in pending state.
               Left(Errors.CONCURRENT_TRANSACTIONS)
+            } else if (txnMetadata.hasNextProducerEpoch) {
+              // InitProducerId(keepPreparedTxn=true) kept the ongoing 
transaction, it can only be committed
+              // or aborted, so adding partitions is not allowed regardless of 
the identity in the request
+              // (including the frozen producerId / producerEpoch used for the 
markers).  A well-behaving
+              // client never adds partitions in this state.
+              Left(Errors.INVALID_TXN_STATE)

Review Comment:
   Cool. We had some issues with kafka streams and some other clients in the 
past, and this error was safer then. 👍 



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