Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
2.1.1
-
None
-
None
Description
Imagine the following pattern to ensure topic creation in an application:
- Attempt to create a topic with # partitions P and replication factor R.
- 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
- is duplicated by
-
KAFKA-8875 CreateTopic API should check topic existence before replication factor
- Resolved
- links to