[
https://issues.apache.org/jira/browse/KAFKA-20537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18101097#comment-18101097
]
Yunseop Eom edited comment on KAFKA-20537 at 8/3/26 8:54 AM:
-------------------------------------------------------------
Follow-up on PR #22945: https://github.com/apache/kafka/pull/22945
Updated in commit 388dbb9505. The implementation preserves the existing-topic
ID through CreateTopicsResult.topicId(topic), while values() and all() retain
TopicExistsException semantics. During TDD review, a quota-timeout path exposed
that the new topicId future could remain pending when the underlying request
failed; the failure handler now completes both future sets with the same
exception and throttle-time calculation.
Verification:
- RED: topicId("topic2") remained incomplete after the existing quota-timeout
scenario.
- GREEN: the regression test now receives ThrottlingQuotaExceededException with
the same throttle time as values().
- Full KafkaAdminClientTest and ReplicationControlManagerTest pass.
- Clients/metadata Spotless, Checkstyle, SpotBugs, and git diff --check pass.
The PR is open and ready for maintainer review.
was (Author: JIRAUSER313210):
Follow-up on PR #22945: https://github.com/apache/kafka/pull/22945
The implementation and focused AdminClient/controller tests are complete.
Existing-topic responses now preserve the topic ID through
CreateTopicsResult.topicId(topic) while values() and all() retain
TopicExistsException semantics.
All required build and JUnit checks are passing. The only failing status is
Gradle Build Scan / Java 25 publication, which reports a build-scan publishing
error; rerunning that check requires repository-admin access. The PR is open
and otherwise ready for maintainer review.
> Return topic-id in CreateTopicsResponse when topic already exists
> -----------------------------------------------------------------
>
> Key: KAFKA-20537
> URL: https://issues.apache.org/jira/browse/KAFKA-20537
> Project: Kafka
> Issue Type: Improvement
> Reporter: Jonah Hooper
> Priority: Minor
>
> If a topic already exists in the CREATE_TOPICS request then we return
> [TOPIC_ALREADY_EXISTS|https://github.com/apache/kafka/blob/3c9b210be3436c0b2086f779ce56db2377ee338e/clients/src/main/java/org/apache/kafka/common/protocol/Errors.java#L256]
> error code. Under this error case the topicId will not be set. Since the
> [topicId|https://github.com/apache/kafka/blob/3c9b210be3436c0b2086f779ce56db2377ee338e/clients/src/main/resources/common/message/CreateTopicsResponse.json#L46]
> does exist if the topic was already created, we should return it as part of
> the RPC.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)