LoganZhuZzz commented on PR #19388:
URL: https://github.com/apache/kafka/pull/19388#issuecomment-2803866042

   
   
   
   > Overall LGTM. Thanks for the patch.
   > 
   > @chia7712 since 4.0 consumers cannot work with broker less than 2.1, could 
we also update this line to 2.1?
   > 
   > 
https://github.com/apache/kafka/blob/a65626b6a806fca960377f9fd5d5383cdcb72946/clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java#L271
   
   @FrankYang0529 Thanks for pointing this out.
   Since the client currently declares `lowestSupportedVersion` = 4 for the 
`Fetch` API, the version negotiation between client and broker will always 
result in a version ≥ 3 as long as the broker supports Fetch version 3 or above.
   Since the baseline version is now 2.1,Kafka 2.1 appears to support 
FetchRequest version 3 or higher?If this is indeed the case, then the legacy 
fallback logic for handling FetchRequest versions < 3 (i.e., the pre-KIP-74 
behavior of throwing `RecordTooLargeException`) becomes unreachable and can be 
safely removed.
   
   Removing this block also simplifies the code and makes the client’s 
compatibility baseline more explicit.
   
   Summary:
   - Client supports Fetch v3+
   - What is the minimum Fetch version supported by Kafka 2.1?
   - If it is ≥ 3, then negotiated version will always be ≥ 3
   - Thus, requestVersion < 3 is no longer possible and the corresponding 
branch is unreachable
   
   cc @chia7712 


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