Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8125

Check for topic existence in CreateTopicsRequest prior to creating replica assignment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.1.1
    • None
    • core
    • None

    Description

      Imagine the following pattern to ensure topic creation in an application:

      1. Attempt to create a topic with # partitions P and replication factor R.
      2.  If topic creation fails with TopicExistsException, continue. If topic creation succeeds, continue, the topic now exists.

      This normally works fine. However, if the topic has already been created, but if the number of live brokers < R, then the topic creation will fail an org.apache.kafka.common.errors.InvalidReplicationFactorException, even though the topic already exists.

      This could be avoided if we check whether the topic exists prior to calling AdminUtils.assignReplicasToBrokers.

       

      Attachments

        Issue Links

          Activity

            People

              huxi_2b huxihx
              lbradstreet Lucas Bradstreet
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: