Skip to content

feat(inkless): ensure unclean leader election is disabled on classic-to-diskless switch [KC-129] - #647

Merged
giuseppelillo merged 3 commits into
mainfrom
EelisK/KC-129-unclean-leader-election
Jun 17, 2026
Merged

feat(inkless): ensure unclean leader election is disabled on classic-to-diskless switch [KC-129]#647
giuseppelillo merged 3 commits into
mainfrom
EelisK/KC-129-unclean-leader-election

Conversation

@EelisK

@EelisK EelisK commented Jun 15, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 strengthens the classic-to-diskless topic switch preconditions by ensuring unclean leader election is not enabled (either already effective via defaults/overrides or being enabled by the same AlterConfigs request), and adds unit/integration coverage around the new behavior.

Changes:

  • Add controller-side validation that rejects classic→diskless switches when unclean.leader.election.enable is enabled (or being enabled) for the topic.
  • Update existing switch-precondition unit tests to use the per-resource validation API and add new tests for unclean-leader-election cases (including legacy AlterConfigs behavior).
  • Add an integration test verifying rejection when unclean leader election is enabled at the cluster/broker-default level, plus a test that unclean-leader-election enabling is rejected while a switch is pending.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Adds unclean-leader-election checks to classic→diskless switch preconditions (incremental + legacy).
metadata/src/test/java/org/apache/kafka/controller/ReplicationControlManagerTest.java Refactors precondition tests to new API and adds unit tests for unclean-leader-election switch rejection/allow cases (including legacy).
core/src/test/java/kafka/server/InklessTopicTypeSwitcherClusterTest.java Adds cluster-level integration coverage for switch rejection when unclean leader election is enabled and for rejecting unclean enable while switch is pending.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Outdated
Comment thread metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Outdated
@EelisK
EelisK force-pushed the EelisK/KC-129-unclean-leader-election branch 2 times, most recently from d284e21 to 5cfb85c Compare June 15, 2026 12:40
@EelisK
EelisK marked this pull request as ready for review June 16, 2026 06:50
Comment thread metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Outdated
Comment thread metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java Outdated
@EelisK
EelisK force-pushed the EelisK/KC-129-unclean-leader-election branch 2 times, most recently from 9623c74 to 38efa2c Compare June 17, 2026 12:11
@EelisK
EelisK requested a review from Copilot June 17, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@EelisK
EelisK force-pushed the EelisK/KC-129-unclean-leader-election branch from 38efa2c to e22416b Compare June 17, 2026 12:41

@giuseppelillo giuseppelillo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just missing a small check from my point of view

@giuseppelillo
giuseppelillo merged commit 6311726 into main Jun 17, 2026
3 checks passed
@giuseppelillo
giuseppelillo deleted the EelisK/KC-129-unclean-leader-election branch June 17, 2026 14:51
giuseppelillo pushed a commit that referenced this pull request Jun 23, 2026
…to-diskless switch [KC-129] (#647)

* fix(inkless): use real validator in classic-to-diskless switch tests

* feat(inkless): ensure unclean leader election is disabled on classic-to-diskless switch

[KC-129]

* test(inkless): test unclean leader election with legacy config alteration
giuseppelillo pushed a commit that referenced this pull request Jun 23, 2026
…to-diskless switch [KC-129] (#647)

* fix(inkless): use real validator in classic-to-diskless switch tests

* feat(inkless): ensure unclean leader election is disabled on classic-to-diskless switch

[KC-129]

* test(inkless): test unclean leader election with legacy config alteration
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