Skip to content

fix(inkless): allow searching offsets in UnifiedLog only if switched topics are in sync#620

Merged
jeqo merged 2 commits into
mainfrom
giuseppelillo/fix-replica-read-switched
May 28, 2026
Merged

fix(inkless): allow searching offsets in UnifiedLog only if switched topics are in sync#620
jeqo merged 2 commits into
mainfrom
giuseppelillo/fix-replica-read-switched

Conversation

@giuseppelillo
Copy link
Copy Markdown
Contributor

Allow OffsetsForLeaderEpoch to be handled by replicas in case they have replicated up to classicToDisklessOffset.
Add the same check for ListOffsets, which previously always allowed requests to be handled by every follower.

…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ListOffsets on whether the local log’s HW has reached the committed switch offset.
  • Allow OffsetsForLeaderEpoch to 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.

@jeqo jeqo merged commit 9caf978 into main May 28, 2026
7 checks passed
@jeqo jeqo deleted the giuseppelillo/fix-replica-read-switched branch May 28, 2026 22:35
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants