brandboat commented on code in PR #18981:
URL: https://github.com/apache/kafka/pull/18981#discussion_r2273873010


##########
core/src/main/scala/kafka/server/AutoTopicCreationManager.scala:
##########
@@ -83,9 +89,30 @@ class DefaultAutoTopicCreationManager(
     uncreatableTopicResponses ++ creatableTopicResponses
   }
 
+  override def createStreamsInternalTopics(
+    topics: Map[String, CreatableTopic],
+    requestContext: RequestContext
+  ): Unit = {
+
+    for ((_, creatableTopic) <- topics) {
+      if (creatableTopic.numPartitions() == -1) {
+        creatableTopic
+          .setNumPartitions(config.numPartitions)
+      }
+      if (creatableTopic.replicationFactor() == -1) {
+        creatableTopic
+          .setReplicationFactor(config.defaultReplicationFactor.shortValue)
+      }
+    }

Review Comment:
   Hi @lucasbru, I was wondering why we’re adding these default values here.
   I thought `ReplicationControlManager#createTopic` already covers this, but I 
might be missing something. c.c. @chia7712 
   
   
https://github.com/apache/kafka/blob/8b49130b928553ad8ee24188b591c2d006d9a394/core/src/main/scala/kafka/server/ControllerServer.scala#L235-L236
   
   
https://github.com/apache/kafka/blob/634e99e9ab16db61990f4922f0a30b6a93f27785/metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java#L767-L770



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

Reply via email to