Skip to content

feat(inkless): Support ListOffsets for all cases of diskless partitions#584

Merged
viktorsomogyi merged 5 commits intomainfrom
giuseppelillo/full-list-offsets
May 6, 2026
Merged

feat(inkless): Support ListOffsets for all cases of diskless partitions#584
viktorsomogyi merged 5 commits intomainfrom
giuseppelillo/full-list-offsets

Conversation

@giuseppelillo
Copy link
Copy Markdown
Contributor

@giuseppelillo giuseppelillo commented Apr 27, 2026

Introduce DisklessFetchOffsetRouter to dispatch ListOffsets queries between the classic UnifiedLog path and the diskless control plane, covering all four diskless-managed partition states:

  1. Pure diskless: answer from the diskless control plane.
  2. Hybrid (classic data still present alongside diskless): route by requested timestamp, with classic↔diskless fallback on no-match or empty results.
  3. Migration pending: classic path only.
  4. Follower ListOffsets on a migrated partition: classic path only.

@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch 5 times, most recently from 0583631 to 6dc6e89 Compare April 29, 2026 09:49
@giuseppelillo giuseppelillo requested a review from Copilot April 29, 2026 10:04
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 updates ReplicaManager.fetchOffset to support more ListOffsets timestamp cases for inkless/diskless (“migrated/hybrid”) partitions, and adds unit tests covering the intended routing between classic (UnifiedLog / tiered) and diskless paths.

Changes:

  • Extend fetchOffset routing logic for migrated/hybrid diskless partitions across multiple ListOffsets timestamp modes (earliest, earliest-local, latest-tiered, max/latest, and specific timestamps).
  • Add disklessFetchOffsetWithClassicFallback to fall back to classic when diskless returns a genuine empty result (including chaining tiered-storage async lookups).
  • Add/extend ReplicaManagerTest coverage for the above routing and fallback behaviors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
core/src/main/scala/kafka/server/ReplicaManager.scala Implements expanded ListOffsets routing for migrated/hybrid diskless partitions and adds a diskless→classic fallback wrapper.
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala Adds unit tests validating classic vs diskless routing and the new fallback behavior (including tiered async chaining).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala Outdated
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from 3889e82 to b03fb79 Compare April 29, 2026 15:07
@giuseppelillo giuseppelillo requested a review from Copilot April 29, 2026 15:31
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from b03fb79 to 78a30c7 Compare April 29, 2026 15:36
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from 78a30c7 to b41b4b4 Compare April 29, 2026 15:38
@giuseppelillo giuseppelillo changed the title feat(inkless): Support all cases for ListOffsets feat(inkless): Support ListOffsets for all cases of diskless partitions Apr 29, 2026
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from b41b4b4 to b9fa5c9 Compare April 29, 2026 15:57
@giuseppelillo giuseppelillo requested a review from Copilot April 29, 2026 15:57
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala Outdated
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from b9fa5c9 to 2924261 Compare April 29, 2026 16:25
@giuseppelillo giuseppelillo marked this pull request as ready for review April 29, 2026 16:25
Copy link
Copy Markdown
Contributor

@jeqo jeqo left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of improvement suggestions

Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala Outdated
Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala
Comment thread core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
Introduce DisklessFetchOffsetRouter to dispatch ListOffsets queries
between the classic UnifiedLog path and the diskless control plane,
covering all four diskless-managed partition states:
  1. Pure diskless: answer from the diskless control plane.
  2. Hybrid (classic data still present alongside diskless): route by
     requested timestamp, with classic↔diskless fallback on no-match
     or empty results.
  3. Migration pending: classic path only
  4. Follower ListOffsets on a migrated partition: classic path only.
Comment thread core/src/main/scala/kafka/server/DisklessFetchOffsetRouter.scala
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/full-list-offsets branch from 2924261 to d9a45bb Compare May 4, 2026 15:59
@viktorsomogyi viktorsomogyi merged commit d3e8a41 into main May 6, 2026
5 checks passed
@viktorsomogyi viktorsomogyi deleted the giuseppelillo/full-list-offsets branch May 6, 2026 08:31
giuseppelillo added a commit that referenced this pull request May 7, 2026
…ns (#584)

Introduce DisklessFetchOffsetRouter to dispatch ListOffsets queries
between the classic UnifiedLog path and the diskless control plane,
covering all four diskless-managed partition states:
  1. Pure diskless: answer from the diskless control plane.
  2. Hybrid (classic data still present alongside diskless): route by
     requested timestamp, with classic↔diskless fallback on no-match
     or empty results.
  3. Migration pending: classic path only
  4. Follower ListOffsets on a migrated partition: classic path only.
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