fix(inkless:consolidation): complete the classic-to-consolidated switch by always sealing and registering#651
Open
viktorsomogyi wants to merge 1 commit into
Open
fix(inkless:consolidation): complete the classic-to-consolidated switch by always sealing and registering#651viktorsomogyi wants to merge 1 commit into
viktorsomogyi wants to merge 1 commit into
Conversation
cff8f1d to
51a1ede
Compare
a766057 to
e6c7bf6
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a deadlock in the classic-to-diskless switch path for consolidating diskless topics by ensuring that, while the switch seal is still pending, the leader always takes the seal+register path (instead of the consolidating become-leader path that would skip sealing).
Changes:
- Update
ReplicaManager.applyLocalLeadersDeltato route “pending switch of an already-online partition” to the seal+register branch even when the topic is already marked consolidating. - Add a regression test that exercises the real two-delta sequence (pending switch → seal commit) and asserts the correct ordering: seal+register first, then consolidation fetcher start after commit.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/src/main/scala/kafka/server/ReplicaManager.scala | Adds an explicit guard so pending classic-to-diskless switches on consolidating topics seal+register before consolidation can start. |
| core/src/test/scala/unit/kafka/server/ReplicaManagerInklessTest.scala | Adds a focused regression test covering the pending-switch leader path and subsequent seal-commit transition into consolidation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ch by always sealing and registering A switch-pending partition must take the seal+register branch in ReplicaManager.applyLocalLeadersDelta even when the topic is already a consolidating diskless topic. Otherwise consolidation claims the partition and the classic log is never sealed, leaving classicToDisklessStartOffset stuck at CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked. Co-authored-by: Cursor <cursoragent@cursor.com>
e6c7bf6 to
497bc4c
Compare
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.
A switch-pending partition must take the seal+register branch in ReplicaManager.applyLocalLeadersDelta even when the topic is already a consolidating diskless topic. Otherwise consolidation claims the partition and the classic log is never sealed, leaving classicToDisklessStartOffset stuck at CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked.