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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -980,6 +1002,28 @@ void handleCoordinatorReady() {
                 null;
         this.coordinatorSupportsBumpingEpoch = initProducerIdVersion != null &&
                 initProducerIdVersion.maxVersion() >= 3;
+
+        if (nodeApiVersions == null) return;
+
+        if (nodeApiVersions.finalizedFeatures() != null) {
+            /*
+                To enable the transaction V2, it requires:
+                1. transaction.version finalized version >= 2

Review Comment:
   I did something a bit different here. Every time the ApiVersions are 
updated, the maxFinalizedFeaturesEpoch among the NodeApiVersions is stored. 
Then the transaction manager can just check this maxFinalizedFeaturesEpoch to 
determine if it needs to check the feature updates.



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