rreddy-22 commented on code in PR #19539:
URL: https://github.com/apache/kafka/pull/19539#discussion_r2082582053


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1453,7 +1481,15 @@ public void handleResponse(AbstractResponse response) {
                 ProducerIdAndEpoch producerIdAndEpoch = new 
ProducerIdAndEpoch(initProducerIdResponse.data().producerId(),
                         initProducerIdResponse.data().producerEpoch());
                 setProducerIdAndEpoch(producerIdAndEpoch);
-                transitionTo(State.READY);
+
+                // If this is a 2PC-enabled transaction with 
keepPreparedTxn=true, transition directly
+                // to PREPARED_TRANSACTION
+                if (enable2PC && builder.data.keepPreparedTxn()) {
+                    transitionTo(State.PREPARED_TRANSACTION);

Review Comment:
   Hmm you're right, I can add a check to see if the response contains an 
ongoing pid 
   



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