AndrewJSchofield commented on code in PR #24208:
URL: https://github.com/apache/kafka/pull/24208#discussion_r4568559694


##########
server-common/src/main/java/org/apache/kafka/server/common/MetadataVersion.java:
##########
@@ -305,7 +313,9 @@ public short partitionRecordVersion() {
     }
 
     public short fetchRequestVersion() {
-        if (isAtLeast(IBP_4_1_IV1)) {
+        if (isAtLeast(IBP_4_5_IV0)) {
+            return 19;

Review Comment:
   This is the tricky part that I mentioned. There are some clients which do 
not do version discovery and they will trip up here.
   
   `FetchRequest` v19 is unstable, so even though the MV says that 19 is 
supported, it is actually only supported if `enable.unstable.api.versions=true` 
is set. So, if you set `enable.unstable.feature.versions=true` and set 
MV=IBP_4_5_IV0 but do not set `enable.unstable.api.versions=true`, then the 
brokers will not be able to replicate data between them. The follower will try 
to use v19 and the broker will refuse because it only supports v18 and lower.
   One answer here is to set both of these flags to true.
   
   There is one case which breaks here too, and that is a client which is built 
from trunk and finds out the latest version without negotiation. 
`ReplicaVerificationTool` does this and it would break. The easiest fix here is 
to change `ApiKeys.FETCH.latestVersion()` to 
`ApiKeys.FETCH.latestVersion(false)`. That seems to fix it to me.
   
   But, the overall point is that we have an unstable feature (pre-production 
MV) and we have unstable API versions too, but the MV responds with the 
unstable API version even when unstable API versions are not enabled.
   
   One way around this would be to change 
`MetadataVersion.fetchRequestVersion()` to take a parameter `boolean 
enableUnstableLastVersion`, and then the caller can provide that flag from its 
config. I'm not sure whether this a practical, but it should be quite easy to 
check it out.



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