-
Notifications
You must be signed in to change notification settings - Fork 14.7k
MINOR: auto-topic creation back-off #20663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a back-off mechanism for auto-topic creation in the AutoTopicCreationManager
to prevent excessive retry attempts on every heartbeat when topic creation fails.
- Filters out topics that have cached errors (back-off period) or are already in-flight
- Prevents redundant topic creation requests during error conditions
- Adds comprehensive unit tests to verify back-off behavior and inflight topic handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
core/src/main/scala/kafka/server/AutoTopicCreationManager.scala | Implements back-off logic by filtering topics with cached errors and inflight requests |
core/src/test/scala/unit/kafka/server/AutoTopicCreationManagerTest.scala | Adds unit tests for back-off mechanism, expired errors, inflight topics, and interaction scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
core/src/main/scala/kafka/server/AutoTopicCreationManager.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Mostly LGTM, I left two comments.
core/src/main/scala/kafka/server/AutoTopicCreationManager.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/kafka/server/AutoTopicCreationManager.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
We seem to have problems with CI and Java 25. Can you try rebasing on latest trunk please? |
e4c3b28
to
319f835
Compare
The auto-topic creation in
AutoTopicCreationManager
currently retriescreating internal topics with every heartbeat.
A simple back-off mechanism was implemented: if there is error in the
errorcache and it's not expired or it's already in the inflight topics,
then not send the topic creation request.
Unit tests are added as well.
Reviewers: Lucas Brutschy [email protected]