mannoopj commented on code in PR #21122:
URL: https://github.com/apache/kafka/pull/21122#discussion_r2620468817


##########
server/src/main/java/org/apache/kafka/server/SimpleApiVersionManager.java:
##########
@@ -67,19 +69,19 @@ public ApiMessageType.ListenerType listenerType() {
 
     @Override
     public ApiVersionsResponse apiVersionResponse(int throttleTimeMs, boolean 
alterFeatureLevel0) {
-        FinalizedFeatures currentFeatures = features();
+        Optional<FinalizedFeatures> currentFeatures = featuresProvider.get();
         return new ApiVersionsResponse.Builder()
                 .setThrottleTimeMs(throttleTimeMs)
                 .setApiVersions(apiVersions)
                 .setSupportedFeatures(brokerFeatures)
-                .setFinalizedFeatures(currentFeatures.finalizedFeatures())
-                
.setFinalizedFeaturesEpoch(currentFeatures.finalizedFeaturesEpoch())
+                
.setFinalizedFeatures(currentFeatures.map(FinalizedFeatures::finalizedFeatures).orElse(Map.of()))

Review Comment:
   ```
   val apiVersionManager = new SimpleApiVersionManager(
           ListenerType.CONTROLLER,
           config.unstableApiVersionsEnabled,
           () => featuresPublisher.features().setFinalizedLevel(
             KRaftVersion.FEATURE_NAME,
             raftManager.client.kraftVersion().featureLevel())
         )
   ```
   This code in `ControllerServer.scala` already adds the `kraft.version`. It 
might not appear in the output if `kraft.version` is 0 and hence gets filtered 
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