m1a2st commented on code in PR #18845:
URL: https://github.com/apache/kafka/pull/18845#discussion_r1953658601


##########
metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java:
##########
@@ -495,8 +495,13 @@ BrokerFeature processRegistrationFeature(
         FinalizedControllerFeatures finalizedFeatures,
         BrokerRegistrationRequestData.Feature feature
     ) {
-        int defaultVersion = 
feature.name().equals(MetadataVersion.FEATURE_NAME) ? 1 : 0; // The default 
value for MetadataVersion is 1 not 0.
-        short finalized = finalizedFeatures.versionOrDefault(feature.name(), 
(short) defaultVersion);
+        // MetadataVersion has no default while the other features default to 
`0`
+        short finalized;
+        if (feature.name().equals(MetadataVersion.FEATURE_NAME))
+            finalized = finalizedFeatures.get(feature.name()).orElseThrow(() 
-> new RuntimeException());

Review Comment:
   I think we should throw a more specific exception or include a clear error 
message.



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