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



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -1213,8 +1238,7 @@ class KafkaApis(val requestChannel: RequestChannel,
     }
 
     val unauthorizedForCreateTopicMetadata = 
unauthorizedForCreateTopics.map(topic =>
-      metadataResponseTopic(Errors.TOPIC_AUTHORIZATION_FAILED, topic, 
isInternal(topic), util.Collections.emptyList()))
-
+      metadataResponseTopic(Errors.TOPIC_AUTHORIZATION_FAILED, topic, 
metadataCache.getTopicId(topic), isInternal(topic), 
util.Collections.emptyList()))

Review comment:
       @jolshan , Thank you, I misunderstood your comments before, I added the 
following changes:
   1. If we are using topicId in metadataReq, we set topicName=null and 
error=UNKNOWN_TOPIC_ID on unauthorized error
   2. If we are using topicName in metadataReq, we set topicId=ZERO and 
error=TOPIC_AUTHORIZATION_FAILED on unauthorized error.
   3. Add a unit test for the above 2 cases.
   @rajinisivaram @jolshan , pleas take a look.




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


Reply via email to