You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "José Armando García Sancio (Jira)" <ji...@apache.org> on 2022/11/04 21:44:00 UTC
[jira] [Created] (KAFKA-14358) Users should not be able to create a regular topic name __cluster_metadata
José Armando García Sancio created KAFKA-14358:
--------------------------------------------------
Summary: Users should not be able to create a regular topic name __cluster_metadata
Key: KAFKA-14358
URL: https://issues.apache.org/jira/browse/KAFKA-14358
Project: Kafka
Issue Type: Bug
Components: controller
Reporter: José Armando García Sancio
Assignee: José Armando García Sancio
Fix For: 3.4.0, 3.3.2
The following test passes and it should not:
{code:java}
$ git diff
diff --git a/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala b/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
index 57834234cc..14b1435d00 100644
--- a/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
+++ b/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
@@ -102,6 +102,12 @@ class CreateTopicsRequestTest extends AbstractCreateTopicsRequestTest {
validateTopicExists("partial-none")
}
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
+ @ValueSource(strings = Array("zk", "kraft"))
+ def testClusterMetadataTopicFails(quorum: String): Unit = {
+ createTopic("__cluster_metadata", 1, 1)
+ }
+
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ValueSource(strings = Array("zk"))
def testCreateTopicsWithVeryShortTimeouts(quorum: String): Unit = {{code}
Result of this test:
{code:java}
$ ./gradlew core:test --tests CreateTopicsRequestTest.testClusterMetadataTopicFails> Configure project :
Starting build with version 3.4.0-SNAPSHOT (commit id bc780c7c) using Gradle 7.5.1, Java 1.8 and Scala 2.13.8
Build properties: maxParallelForks=12, maxScalacThreads=8, maxTestRetries=0> Task :core:testGradle Test Run :core:test > Gradle Test Executor 8 > CreateTopicsRequestTest > testClusterMetadataTopicFails(String) > kafka.server.CreateTopicsRequestTest.testClusterMetadataTopicFails(String)[1] PASSEDGradle Test Run :core:test > Gradle Test Executor 8 > CreateTopicsRequestTest > testClusterMetadataTopicFails(String) > kafka.server.CreateTopicsRequestTest.testClusterMetadataTopicFails(String)[2] PASSEDBUILD SUCCESSFUL in 44s
44 actionable tasks: 3 executed, 41 up-to-date
{code}
I think that this test should fail in both KRaft and ZK. We want this to fail in ZK so that it can be migrated to KRaft.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)