fix(kafka): block unsafe KRaft controller scale-in#3219
Draft
weicao wants to merge 4 commits into
Draft
Conversation
weicao
requested review from
a team,
JashBook,
ahjing99,
caiq1nyu,
cjc7373,
leon-ape and
shanshanying
as code owners
July 15, 2026 15:09
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## audrey/pr3168-kb-comp-replicas #3219 +/- ##
==============================================================
Coverage 0.00% 0.00%
==============================================================
Files 75 76 +1
Lines 9341 9426 +85
==============================================================
- Misses 9341 9426 +85 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
leon-ape
marked this pull request as draft
July 20, 2026 02:53
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.
Problem
Kafka KRaft controller membership in this addon uses a static
controller.quorum.voterslist. The controller-bearing ComponentDefinitions did not define amemberLeaveaction, so a 3-to-1 scale-in could delete two controller Pods while Kafka still expected voter IDs 0/1/2. The operation could report success even though the remaining broker could no longer complete bounded topic creation.Solution
memberLeavefailure action tokafka-combineandkafka-controlleronly.1.1.0-alpha.2, including all version-derived immutable object names and references.Evidence
Exact candidate:
67200df711766c01ec7a33829c1b0ee041b1f32a1.1.0-alpha.278eebdf97d1f714858ca529c2fad18d67fe180fe379fa6753179cf0a558f314600a42539b98b1ae5aRuntime validation on Kafka 3.3.2 is cumulative N=2 and clean for all six tested topology rows:
For the four protected rows, both target replicas invoked the lifecycle action and returned the fixed failure diagnostic before deletion. The OpsRequests ended
Aborted; InstanceSet identity, actual replica count, Pod UIDs, KRaft voters, and exact business markers remained unchanged. No recovery patch or manual repair was used.For the two broker-only rows, the OpsRequests succeeded, broker replicas converged to the requested count, retained broker UIDs stayed stable, controller InstanceSet/Pod identities and voters stayed unchanged, and exact post-scale business markers passed.
The old-Component upgrade path was also exercised twice: healthy
1.1.0-alpha.0cluster -> supported ComponentDefinition upgrade -> exact1.1.0-alpha.2readback and business roundtrip -> combined 3-to-1 fail-closed result -> ordinary cleanup. Both runs closed cleanly.Every accepted run used ordinary namespace cleanup to explicit
NotFound, with scoped PV/Backup/Restore residue 0 and no force or finalizer modification.Boundaries
Updatingwas rejected before scale-in and remains N=0. No product conclusion is drawn from that lane.367d32f5098a99582b22d4c72d5c28efa5e8d8df; retarget after that base is integrated.Reviewer focus
Please focus on:
memberLeave;alpha.2immutable names and references move together;