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


##########
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:
   Maybe I'm missing something, but can we store this within ApiVersions and 
update the value every time a new apiVersions request is handled? We already 
call  `apiVersions.update(node, nodeVersionInfo);` and that does a calculation 
for max produce magic, so could we do another method in update to check the 
epoch and if it is greater than the existing epoch, we update the internal 
value in ApiVersions? (We may need to add epoch to NodeApiVersions -- and this 
is not a public api)



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