junrao commented on code in PR #19635: URL: https://github.com/apache/kafka/pull/19635#discussion_r2073910505
########## core/src/main/scala/kafka/server/KafkaApis.scala: ########## @@ -413,8 +413,6 @@ class KafkaApis(val requestChannel: RequestChannel, val topicPartition = new TopicPartition(topicName, partition.index()) if (topicName.isEmpty) Review Comment: This is another subtle existing issue. If a produce request before v13 has an empty topic name, we used to return UNKNOWN_TOPIC_OR_PARTITION. Now, we return UNKNOWN_TOPIC_ID. It's probably better to change the condition to `if (topicName.isEmpty && topic.topicId().equals(Uuid.ZERO_UUID))`. ########## core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala: ########## @@ -924,6 +924,33 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest { sendRequests(requestKeyToRequest, false, topicNames) } + @Test + def testAuthorizationWithTopicNotExistingForProduceReqeustVersionLessThan13(): Unit = { + for (version <- ApiKeys.PRODUCE.oldestVersion to 12) { + val request = requests.ProduceRequest.builder(new ProduceRequestData() + .setTopicData(new ProduceRequestData.TopicProduceDataCollection( + util.List.of(new ProduceRequestData.TopicProduceData() + .setName(tp.topic()) Review Comment: We could. I am just pointing out this doesn't match the test name, which says `WithTopicNotExisting`. -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org