Skip to content

feat: batch remove_broker operations into single CruiseControl task#251

Open
dobrerazvan wants to merge 1 commit into
masterfrom
feat/batch-remove-broker
Open

feat: batch remove_broker operations into single CruiseControl task#251
dobrerazvan wants to merge 1 commit into
masterfrom
feat/batch-remove-broker

Conversation

@dobrerazvan
Copy link
Copy Markdown

@dobrerazvan dobrerazvan commented May 13, 2026

When removing multiple brokers from a KafkaCluster spec, the operator previously created one CruiseControlOperation per broker. CC can only run one operation at a time, causing data to be shuffled onto brokers that will themselves be decommissioned, far more partition movements than necessary.

Collect all broker IDs in GracefulDownscaleRequired state and submit them as a single remove_broker CC operation, mirroring the existing addBrokers pattern. Because the KafkaCluster reconciler sets all removed brokers to Required via a single atomic status patch, all brokers from a single manifest apply are guaranteed to land in the same batch.

Includes unit test (createCCOperation multi-broker params), integration test (exactly one CCOperation created for two simultaneous removals), e2e test scaffold, and 5-broker sample manifest.

Description

Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to
related issues, other PRs, or technical references.

Note that by not including a description, you are asking reviewers to do extra work to understand the context of this
change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

When removing multiple brokers from a KafkaCluster spec, the operator
previously created one CruiseControlOperation per broker. CC can only
run one operation at a time, causing data to be shuffled onto brokers
that will themselves be decommissioned, far more partition movements
than necessary.

Collect all broker IDs in GracefulDownscaleRequired state and submit
them as a single remove_broker CC operation, mirroring the existing
addBrokers pattern. Because the KafkaCluster reconciler sets all
removed brokers to Required via a single atomic status patch, all
brokers from a single manifest apply are guaranteed to land in the
same batch.

Includes unit test (createCCOperation multi-broker params), integration
test (exactly one CCOperation created for two simultaneous removals),
e2e test scaffold, and 5-broker sample manifest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant