feat(inkless): fast fail producing during classic-to-diskless migration#595
Merged
Conversation
Currently, producing messages to partitions mid-migration causes `UNKNOWN_TOPIC_OR_PARTITION` errors, which can be misleading for producers. This commit changes the behaviour by filtering out partitions that are being migrated, and responding with `REPLICA_NOT_AVAILABLE` for those.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts produce (append) behavior for diskless topics during classic-to-diskless migration so that partitions in the “migration pending” state fail fast with REPLICA_NOT_AVAILABLE (instead of surfacing misleading UNKNOWN_TOPIC_OR_PARTITION outcomes).
Changes:
- In
ReplicaManager.appendRecords, split diskless produce entries into “pending migration” vs “ready” and exclude pending partitions from the diskless append handler. - Return
REPLICA_NOT_AVAILABLEper-partition responses for “migration pending” partitions while still producing to other ready diskless partitions and/or classic partitions. - Add unit tests covering pending-only, mixed pending+ready, handler failure, and mixed pending+classic scenarios.
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 | Filters diskless produce entries that are CLASSIC_TO_DISKLESS_MIGRATION_PENDING and returns REPLICA_NOT_AVAILABLE for them, while sending only ready diskless partitions to AppendHandler. |
| core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala | Adds test coverage ensuring pending-migration partitions return REPLICA_NOT_AVAILABLE and that ready partitions/classic partitions behave as expected (including handler failure fallback). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
giuseppelillo
approved these changes
May 15, 2026
giuseppelillo
pushed a commit
that referenced
this pull request
May 15, 2026
…on (#595) Currently, producing messages to partitions mid-migration causes `UNKNOWN_TOPIC_OR_PARTITION` errors, which can be misleading for producers. This commit changes the behaviour by filtering out partitions that are being migrated, and responding with `REPLICA_NOT_AVAILABLE` for those.
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.
Currently, producing messages to partitions mid-migration causes
UNKNOWN_TOPIC_OR_PARTITIONerrors, which can be misleading for producers. This commit changes the behaviour by filtering out partitions that are being migrated, and responding withREPLICA_NOT_AVAILABLEfor those.