Skip to content

fix(inkless:consolidation): route ListOffsets(EARLIEST) to the control plane for consolidating topics [KC-332]#709

Merged
giuseppelillo merged 1 commit into
mainfrom
svv/ts-unification-listoffsets-earliest
Jul 22, 2026
Merged

fix(inkless:consolidation): route ListOffsets(EARLIEST) to the control plane for consolidating topics [KC-332]#709
giuseppelillo merged 1 commit into
mainfrom
svv/ts-unification-listoffsets-earliest

Conversation

@viktorsomogyi

Copy link
Copy Markdown
Contributor

For a switched consolidating topic the earliest offset was served from the broker-local classic UnifiedLog.logStartOffset, which is frozen at the switch on followers, so ListOffsets(EARLIEST) diverged across brokers depending on which replica the metadata transformer routed the client to.
DisklessFetchOffsetRouter now routes EARLIEST for every consolidating partition (born-consolidated and switched) to the authoritative control-plane cross-tier earliest, giving one consistent answer on every broker. Non-consolidating switched partitions keep the classic leg while it still owns the pre-switch prefix.

@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-listoffsets-earliest branch from d85bf1e to 7310570 Compare July 21, 2026 14:41
…l plane for consolidating topics [KC-332]

PR 4

Problem A: for a switched consolidating topic the earliest offset was
served from the broker-local classic UnifiedLog.logStartOffset, which is
frozen at the switch on followers, so ListOffsets(EARLIEST) diverged
across brokers depending on which replica the metadata transformer routed
the client to. DisklessFetchOffsetRouter now routes EARLIEST for every
consolidating partition (born-consolidated and switched) to the
authoritative control-plane cross-tier earliest, giving one consistent
answer on every broker. Non-consolidating switched partitions keep the
classic leg while it still owns the pre-switch prefix.

Co-authored-by: Cursor <cursoragent@cursor.com>
@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-listoffsets-earliest branch from 7310570 to bace6f7 Compare July 21, 2026 14:53
@viktorsomogyi
viktorsomogyi requested a review from Copilot July 21, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes inconsistent ListOffsets(EARLIEST) results for consolidating diskless topics by ensuring the request is always served via the control plane’s broker-agnostic cross-tier earliest rather than potentially stale broker-local classic log state (notably on followers after a switch).

Changes:

  • Update DisklessFetchOffsetRouter to route EARLIEST_TIMESTAMP to the diskless/control-plane leg for all consolidating partitions (born-consolidated and switched), while preserving classic handling for non-consolidating switched partitions that still own a pre-switch prefix.
  • Update and extend unit tests to assert the new routing behavior and add a regression guard ensuring consistent earliest offsets across brokers with different local classic log starts.

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/DisklessFetchOffsetRouter.scala Changes EARLIEST routing logic to always use control plane for consolidating partitions; keeps classic path for non-consolidating switched partitions while classic prefix exists.
core/src/test/scala/unit/kafka/server/DisklessFetchOffsetRouterTest.scala Updates existing tests to match new semantics and adds a new regression test ensuring EARLIEST consistency across brokers.

@viktorsomogyi
viktorsomogyi marked this pull request as ready for review July 21, 2026 15:04
@giuseppelillo
giuseppelillo merged commit 393f031 into main Jul 22, 2026
9 checks passed
@giuseppelillo
giuseppelillo deleted the svv/ts-unification-listoffsets-earliest branch July 22, 2026 13:27
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.

3 participants