fix(inkless): allow searching offsets in UnifiedLog only if switched topics are in sync#620
Merged
Merged
Conversation
…y replicas Replicas of switched topics from classic to diskless should handle ListOffsets searches only if UnifiedLog if fully replicated from the leader. Cases like new replicas that have just been added as should not handle ListOffsets requests.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens classic-path offset lookup behavior for diskless “hybrid/switched” partitions so that followers only serve classic-side ListOffsets / OffsetsForLeaderEpoch when they have fully caught up to the committed classicToDisklessStartOffset (the sealed classic prefix boundary).
Changes:
- Gate classic-path follower handling for
ListOffsetson whether the local log’s HW has reached the committed switch offset. - Allow
OffsetsForLeaderEpochto be answered by non-leader replicas only when they have the complete sealed classic prefix locally. - Add/extend unit tests covering the boundary cases for both routing (
ListOffsets) and leader-epoch lookups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/src/main/scala/kafka/server/ReplicaManager.scala | Passes a “complete classic prefix” predicate into DisklessFetchOffsetRouter and relaxes OffsetsForLeaderEpoch leader-only behavior only when the local sealed prefix is complete. |
| core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala | Adds follower-eligibility gating based on completeness of the sealed classic prefix when routing ListOffsets on switched/hybrid partitions. |
| core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala | Adds tests asserting follower behavior at the switch boundary for lastOffsetForLeaderEpoch (allowed when caught up; rejected when lagging). |
| core/src/test/scala/unit/kafka/server/DisklessFetchOffsetRouterTest.scala | Adds tests ensuring switched/hybrid follower access is denied when the classic prefix is incomplete (including consolidating + committed-boundary scenarios). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
viktorsomogyi
approved these changes
May 28, 2026
jeqo
approved these changes
May 28, 2026
giuseppelillo
added a commit
that referenced
this pull request
May 29, 2026
…topics are in sync (#620) Replicas of switched topics from classic to diskless should handle ListOffsets searches only if UnifiedLog if fully replicated from the leader. Cases like new replicas that have just been added as should not handle ListOffsets requests.
giuseppelillo
added a commit
that referenced
this pull request
May 29, 2026
…topics are in sync (#620) Replicas of switched topics from classic to diskless should handle ListOffsets searches only if UnifiedLog if fully replicated from the leader. Cases like new replicas that have just been added as should not handle ListOffsets requests.
giuseppelillo
added a commit
that referenced
this pull request
May 29, 2026
…topics are in sync (#620) Replicas of switched topics from classic to diskless should handle ListOffsets searches only if UnifiedLog if fully replicated from the leader. Cases like new replicas that have just been added as should not handle ListOffsets requests.
giuseppelillo
added a commit
that referenced
this pull request
May 29, 2026
…topics are in sync (#620) Replicas of switched topics from classic to diskless should handle ListOffsets searches only if UnifiedLog if fully replicated from the leader. Cases like new replicas that have just been added as should not handle ListOffsets requests.
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.
Allow
OffsetsForLeaderEpochto be handled by replicas in case they have replicated up toclassicToDisklessOffset.Add the same check for
ListOffsets, which previously always allowed requests to be handled by every follower.