OmniaGM commented on code in PR #15968: URL: https://github.com/apache/kafka/pull/15968#discussion_r1639052751
########## 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: We only check ids for topic included in the batch, and we catch these from the metadata which at this point the producer already fetched them or cached them. -- 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