Skip to content

Make topic exists error silent in Kafka 3.0 createTopic#17767

Merged
xiangfu0 merged 1 commit intoapache:masterfrom
xiangfu0:fix-kafka30-topic-exists-silent
Feb 26, 2026
Merged

Make topic exists error silent in Kafka 3.0 createTopic#17767
xiangfu0 merged 1 commit intoapache:masterfrom
xiangfu0:fix-kafka30-topic-exists-silent

Conversation

@xiangfu0
Copy link
Contributor

Summary

Handle TopicExistsException in KafkaServerStartable.createTopic by returning silently when the topic already exists, matching the behavior of kafka20 clients.

Problem

Quickstart fails with RuntimeException: Failed to create topic: flights-realtime when the topic already exists (e.g., from a previous run).

Solution

Catch ExecutionException with cause TopicExistsException and return silently instead of rethrowing, consistent with kafka20 behavior.

Testing

  • KafkaServerStartableTest passes

Made with Cursor

Handle TopicExistsException in KafkaServerStartable.createTopic by
returning silently when the topic already exists, matching the behavior
of kafka20 clients. This prevents quickstart from failing when topics
like flights-realtime already exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.23%. Comparing base (6dabd1d) to head (fd25469).

Files with missing lines Patch % Lines
...in/stream/kafka30/server/KafkaServerStartable.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17767      +/-   ##
============================================
+ Coverage     63.21%   63.23%   +0.02%     
  Complexity     1454     1454              
============================================
  Files          3179     3179              
  Lines        191279   191282       +3     
  Branches      29251    29253       +2     
============================================
+ Hits         120909   120952      +43     
+ Misses        60930    60894      -36     
+ Partials       9440     9436       -4     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.19% <0.00%> (+<0.01%) ⬆️
java-21 63.19% <0.00%> (+0.01%) ⬆️
temurin 63.23% <0.00%> (+0.02%) ⬆️
unittests 63.22% <0.00%> (+0.02%) ⬆️
unittests1 55.61% <ø> (+0.01%) ⬆️
unittests2 34.12% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xiangfu0 xiangfu0 merged commit a95db2b into apache:master Feb 26, 2026
14 of 16 checks passed
@xiangfu0 xiangfu0 deleted the fix-kafka30-topic-exists-silent branch February 26, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants