You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/10/24 07:51:31 UTC

[GitHub] [kafka] showuon opened a new pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

showuon opened a new pull request #11429:
URL: https://github.com/apache/kafka/pull/11429


   In https://github.com/apache/kafka/pull/10457/files#r635196307, the reviewer asked if there's a bug that we only check for zookeeper case, I didn't do a well check and directly confirm it. Now, after checking the change history, I found the change is because the [KIP-464](https://cwiki.apache.org/confluence/display/KAFKA/KIP-464%3A+Defaults+for+AdminClient%23createTopic) (PR: https://github.com/apache/kafka/pull/6728) added default values for partition count and replica factor for createTopic in AdminClient. So it didn't apply for zookeeper option case. 
   
   Fix this bug and add tests for the command lines in quick start (i.e. create topic and describe topic), to make sure it won't be broken in the future.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-960575313


   @ijuma , please help check it when available. This is a regression issue, so I think we should put it v3.1.0. Thank you.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961343546


   @ijuma Should we pick this one to the 3.1 branch as well? 


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on a change in pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
showuon commented on a change in pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#discussion_r735079492



##########
File path: core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
##########
@@ -123,6 +123,25 @@ class TopicCommandTest {
           "--topic", topicName)))
   }
 
+  @Test
+  def testCreateWithoutPartitionCountAndReplicationFactorShouldSucceed(): Unit = {
+    val opts = new TopicCommandOptions(
+      Array("--bootstrap-server", brokerList,
+        "--create",
+        "--topic", topicName))
+    opts.checkArgs()
+  }
+
+  @Test
+  def testDescribeShouldSucceed(): Unit = {
+    val opts = new TopicCommandOptions(
+      Array("--bootstrap-server", brokerList,
+        "--describe",
+        "--topic", topicName))
+    opts.checkArgs()
+  }

Review comment:
       Make sure the 2 command lines from quick start will pass successfully.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-950278601


   @ijuma , please help check this PR when available. Thank you.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma merged pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
ijuma merged pull request #11429:
URL: https://github.com/apache/kafka/pull/11429


   


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961367197


   @dajac Makes sense, pushed to trunk, 3.1 and 3.0.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961367197


   @dajac Makes sense, pushed to trunk, 3.1 and 3.0.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-960951629


   Yes, cherry-pick back to v3.0.1, too, please. Thank you!


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961343546


   @ijuma Should we pick this one to the 3.1 branch as well? 


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dongjinleekr commented on a change in pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
dongjinleekr commented on a change in pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#discussion_r735114228



##########
File path: core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
##########
@@ -123,6 +123,25 @@ class TopicCommandTest {
           "--topic", topicName)))
   }
 
+  @Test
+  def testCreateWithoutPartitionCountAndReplicationFactorShouldSucceed(): Unit = {
+    val opts = new TopicCommandOptions(
+      Array("--bootstrap-server", brokerList,
+        "--create",
+        "--topic", topicName))
+    opts.checkArgs()
+  }
+
+  @Test
+  def testDescribeShouldSucceed(): Unit = {
+    val opts = new TopicCommandOptions(
+      Array("--bootstrap-server", brokerList,
+        "--describe",
+        "--topic", topicName))
+    opts.checkArgs()
+  }

Review comment:
       I love this case-by-case approach + it also works like a charm. :smiley:
   ![20211024-214641](https://user-images.githubusercontent.com/2375128/138594843-52779e07-31ea-4f85-af5b-c25b56025b77.png)




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961343546


   @ijuma Should we pick this one to the 3.1 branch as well? 


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] showuon commented on a change in pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
showuon commented on a change in pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#discussion_r735079413



##########
File path: core/src/main/scala/kafka/admin/TopicCommand.scala
##########
@@ -625,8 +625,6 @@ object TopicCommand extends Logging {
       }
       if (!has(listOpt) && !has(describeOpt))
         CommandLineUtils.checkRequiredArgs(parser, options, topicOpt)
-      if (has(createOpt) && !has(replicaAssignmentOpt))
-        CommandLineUtils.checkRequiredArgs(parser, options, partitionsOpt, replicationFactorOpt)

Review comment:
       remove them since it is only checked for zookeeper option case before.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-960945328


   @showuon we should have this in 3.0.1 too, right?


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on pull request #11429: KAFKA-13396: allow create topic without partition/replicaFactor

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #11429:
URL: https://github.com/apache/kafka/pull/11429#issuecomment-961367197


   @dajac Makes sense, pushed to trunk, 3.1 and 3.0.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org