Skip to content

Conversation

RaidenE1
Copy link
Contributor

@RaidenE1 RaidenE1 commented Oct 8, 2025

The auto-topic creation in AutoTopicCreationManager currently retries
creating 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]

@github-actions github-actions bot added triage PRs from the community core Kafka Broker labels Oct 8, 2025
@RaidenE1
Copy link
Contributor Author

RaidenE1 commented Oct 8, 2025

/gemini review

@lucasbru lucasbru self-assigned this Oct 9, 2025
@lucasbru lucasbru requested review from Copilot and lucasbru October 9, 2025 09:26
Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link
Member

@lucasbru lucasbru left a 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.

@github-actions github-actions bot removed the triage PRs from the community label Oct 10, 2025
Copy link
Member

@lucasbru lucasbru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lucasbru
Copy link
Member

We seem to have problems with CI and Java 25. Can you try rebasing on latest trunk please?

@RaidenE1 RaidenE1 force-pushed the topic-creation-backoff branch from e4c3b28 to 319f835 Compare October 10, 2025 13:17
@lucasbru lucasbru merged commit 2f260d7 into apache:trunk Oct 10, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants