junrao commented on code in PR #16421:
URL: https://github.com/apache/kafka/pull/16421#discussion_r1669372235


##########
clients/src/main/java/org/apache/kafka/common/requests/BrokerRegistrationRequest.java:
##########
@@ -45,7 +46,21 @@ public short oldestAllowedVersion() {
 
         @Override
         public BrokerRegistrationRequest build(short version) {
-            return new BrokerRegistrationRequest(data, version);
+            if (version < 4) {
+                // Workaround for KAFKA-17011: for BrokerRegistrationRequest 
versions older than 4,
+                // exclude support version ranges that begin with 0.

Review Comment:
   It seems that it's simpler for the old BrokerRegistrationRequest to be 
consistent with the older version of ApiVersionResponse, i.e., to include the 
feature but set the minSupportedVersion to 1, instead of 0.



##########
clients/src/main/resources/common/message/BrokerRegistrationRequest.json:
##########
@@ -45,7 +48,7 @@
     ]
     },
     { "name": "Features", "type": "[]Feature",
-      "about": "The features on this broker", "versions": "0+", "fields": [
+      "about": "The features on this broker. Note: in v0-v3, features with 
MinSupportedVersion = 0 must be left out.", "versions": "0+", "fields": [

Review Comment:
   > Note: in v0-v3, features with MinSupportedVersion = 0 must be left out.
   
   This needs to be adjusted accordingly since we now keep the feature but 
returns 1 as the minSupportedVersion. 



##########
clients/src/main/resources/common/message/ApiVersionsResponse.json:
##########
@@ -45,7 +47,7 @@
       "about": "The duration in milliseconds for which the request was 
throttled due to a quota violation, or zero if the request did not violate any 
quota." },
     { "name":  "SupportedFeatures", "type": "[]SupportedFeatureKey", 
"ignorable": true,
       "versions":  "3+", "tag": 0, "taggedVersions": "3+",
-      "about": "Features supported by the broker.",
+      "about": "Features supported by the broker. Note: in v0-v3, features 
with MinSupportedVersion = 0 must be left out.",

Review Comment:
   > Note: in v0-v3, features with MinSupportedVersion = 0 must be left out.
   
   This needs to be adjusted accordingly since we now keep the feature but 
returns 1 as the minSupportedVersion.



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