jolshan commented on a change in pull request #9684: URL: https://github.com/apache/kafka/pull/9684#discussion_r564914537
########## File path: core/src/main/scala/kafka/server/KafkaApis.scala ########## @@ -1930,29 +1932,43 @@ class KafkaApis(val requestChannel: RequestChannel, val results = new DeletableTopicResultCollection(deleteTopicRequest.data.topicNames.size) val toDelete = mutable.Set[String]() if (!controller.isActive) { - deleteTopicRequest.data.topicNames.forEach { topic => + deleteTopicRequest.topics().forEach { topic => results.add(new DeletableTopicResult() - .setName(topic) + .setName(topic.name()) + .setTopicId(topic.topicId()) .setErrorCode(Errors.NOT_CONTROLLER.code)) } sendResponseCallback(results) } else if (!config.deleteTopicEnable) { val error = if (request.context.apiVersion < 3) Errors.INVALID_REQUEST else Errors.TOPIC_DELETION_DISABLED - deleteTopicRequest.data.topicNames.forEach { topic => + deleteTopicRequest.topics().forEach { topic => results.add(new DeletableTopicResult() - .setName(topic) + .setName(topic.name()) + .setTopicId(topic.topicId()) .setErrorCode(error.code)) } sendResponseCallback(results) } else { - deleteTopicRequest.data.topicNames.forEach { topic => + deleteTopicRequest.topics().forEach { topic => + val name = if (topic.topicId().equals(Uuid.ZERO_UUID)) topic.name() + else controller.controllerContext.topicNames.getOrElse(topic.topicId(), null) Review comment: The way the requests are built, it is not possible to provide both. But if this somehow happened, we would want to use topic IDs as specified in the KIP. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org