CalvinConfluent commented on code in PR #17698:
URL: https://github.com/apache/kafka/pull/17698#discussion_r1847489952


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -394,8 +402,10 @@ public synchronized void maybeAddPartition(TopicPartition 
topicPartition) {
             } else if (currentState != State.IN_TRANSACTION) {
                 throw new IllegalStateException("Cannot add partition " + 
topicPartition +
                     " to transaction while in state  " + currentState);
-            } else if (isPartitionAdded(topicPartition) || 
isPartitionPendingAdd(topicPartition)) {
+            } else if (transactionContainsPartition(topicPartition) || 
isPartitionPendingAdd(topicPartition)) {
                 return;
+            } else if (isTransactionV2Enabled()) {

Review Comment:
   I refactored this part. transactionContainsPartition no long always returns 
true with V2



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