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

Check for topic existence in CreateTopicsRequest prior to creating replica assignment

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      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

              • Assignee:
                huxi_2b huxihx
                Reporter:
                lbradstreet Lucas Bradstreet
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: