You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dengziming (via GitHub)" <gi...@apache.org> on 2023/06/07 06:59:42 UTC

[GitHub] [kafka] dengziming commented on a diff in pull request #13679: KAFKA-14291: KRaft controller should return right finalized features in ApiVersionResponse

dengziming commented on code in PR #13679:
URL: https://github.com/apache/kafka/pull/13679#discussion_r1220994605


##########
core/src/main/scala/kafka/server/ApiVersionManager.scala:
##########
@@ -112,4 +157,8 @@ class DefaultApiVersionManager(
       zkMigrationEnabled
     )
   }
+
+  override def apiVersionResponse(throttleTimeMs: Int, finalizedFeatures: Map[String, java.lang.Short], finalizedFeatureEpoch: Long): ApiVersionsResponse = {
+    throw new UnsupportedOperationException("This method is not supported in DefaultApiVersionManager, use apiVersionResponse(throttleTimeMs) instead")

Review Comment:
   The `features` in `ApiVersionResponse` is retrieved directly from `MetadataCache` in BrokerServer/KafkaServer, but in ControllerServer it can only be got asynchronized and can't be unified, so I added 2 different methods here.
    I'm still checking whether there are better way to handle this, one way is to add a synchronized method to controller, another is to make `ApiVersionManager.apiVersionResponse` asynchronized, both will introduce new problems, the root cause is that `ApiVersionRequest` is treated static but finalized features is changing dynamically.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org