You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/02/17 09:52:10 UTC

[GitHub] [kafka] dengziming commented on a change in pull request #11784: KAFKA-13228; Ensure ApiVersionRequest is properly handled KRaft co-resident mode

dengziming commented on a change in pull request #11784:
URL: https://github.com/apache/kafka/pull/11784#discussion_r808859493



##########
File path: core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala
##########
@@ -159,12 +161,12 @@ class BrokerToControllerChannelManagerImpl(
   config: KafkaConfig,
   channelName: String,
   threadNamePrefix: Option[String],
-  retryTimeoutMs: Long
+  retryTimeoutMs: Long,
+  currentNodeControllerApiVersions: Option[NodeApiVersions]
 ) extends BrokerToControllerChannelManager with Logging {
   private val logContext = new LogContext(s"[BrokerToControllerChannelManager broker=${config.brokerId} name=$channelName] ")
   private val manualMetadataUpdater = new ManualMetadataUpdater()
   private val apiVersions = new ApiVersions()
-  private val currentNodeApiVersions = NodeApiVersions.create()

Review comment:
       This is the source of the bug, we always assume currentNodeApiVersions=`ApiKeys.zkBrokerApis` 

##########
File path: core/src/test/scala/unit/kafka/server/ApiVersionsRequestCoResidentTest.scala
##########
@@ -0,0 +1,55 @@
+/**
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to You under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  *    http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+
+package kafka.server
+
+import kafka.test.ClusterInstance
+import kafka.test.annotation.{ClusterTest, ClusterTestDefaults, Type}
+import kafka.test.junit.ClusterTestExtensions
+import org.apache.kafka.common.message.ApiVersionsRequestData
+import org.apache.kafka.common.protocol.Errors
+import org.apache.kafka.common.requests.ApiVersionsRequest
+import org.junit.jupiter.api.Assertions._
+import org.junit.jupiter.api.extension.ExtendWith
+
+
+@ExtendWith(value = Array(classOf[ClusterTestExtensions]))
+@ClusterTestDefaults(clusterType = Type.KRAFT, brokers = 1)
+class ApiVersionsRequestCoResidentTest(cluster: ClusterInstance) extends AbstractApiVersionsRequestTest(cluster) {
+
+  @ClusterTest(coResident = true)

Review comment:
       I want to extend ClusterTestKit to add a new clusterType=Type.CO_KRAFT, but this is not a minor work.




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