feat(inkless): ensure unclean leader election is disabled on classic-to-diskless switch [KC-129] - #647
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.enableis 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.
EelisK
force-pushed
the
EelisK/KC-129-unclean-leader-election
branch
2 times, most recently
from
June 15, 2026 12:40
d284e21 to
5cfb85c
Compare
EelisK
marked this pull request as ready for review
June 16, 2026 06:50
giuseppelillo
requested changes
Jun 16, 2026
EelisK
force-pushed
the
EelisK/KC-129-unclean-leader-election
branch
2 times, most recently
from
June 17, 2026 12:11
9623c74 to
38efa2c
Compare
…to-diskless switch [KC-129]
EelisK
force-pushed
the
EelisK/KC-129-unclean-leader-election
branch
from
June 17, 2026 12:41
38efa2c to
e22416b
Compare
giuseppelillo
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just missing a small check from my point of view
giuseppelillo
approved these changes
Jun 17, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.