OmniaGM commented on code in PR #15968:
URL: https://github.com/apache/kafka/pull/15968#discussion_r1638072873


##########
clients/src/main/java/org/apache/kafka/clients/ApiVersions.java:
##########
@@ -34,10 +34,21 @@ public class ApiVersions {
 
     private final Map<String, NodeApiVersions> nodeApiVersions = new 
HashMap<>();
     private byte maxUsableProduceMagic = RecordBatch.CURRENT_MAGIC_VALUE;
+    private short maxProduceSupportedVersion = ApiKeys.PRODUCE.latestVersion();
 
     public synchronized void update(String nodeId, NodeApiVersions 
nodeApiVersions) {
         this.nodeApiVersions.put(nodeId, nodeApiVersions);
         this.maxUsableProduceMagic = computeMaxUsableProduceMagic();
+        this.maxProduceSupportedVersion = computeMaxProduceSupportedVersion();
+    }
+
+    private short computeMaxProduceSupportedVersion() {
+        Optional<Short> knownBrokerNodesMinSupportedVersionForProduce = 
this.nodeApiVersions.values().stream()

Review Comment:
   > I wonder if we should also confirm that the IBP is at least 2.8 on the 
cluster. (Note this only applies to ZK clusters as all kraft clusters are 3.0 
and above/have topic IDs)
   
   I don't think the client access the IBP of the broker. It only access the 
min/max supported versions of a request which IBP is just a proxy for. Am I 
missing a route on client side that access IBP versions?
   
   I use `!topicIds.entrySet().stream().anyMatch(e -> e.getValue() == 
Uuid.ZERO_UUID)` to make sure the `ProducerMetadata` as well is a topic id 
aware as this is another request that we relay on to map between topic and 
topic ids



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