Skip to content

feat(inkless:switch): support DELETE_RECORDS for hybrid partitions#611

Merged
viktorsomogyi merged 5 commits into
mainfrom
giuseppelillo/hybrid-delete-records
May 27, 2026
Merged

feat(inkless:switch): support DELETE_RECORDS for hybrid partitions#611
viktorsomogyi merged 5 commits into
mainfrom
giuseppelillo/hybrid-delete-records

Conversation

@giuseppelillo

@giuseppelillo giuseppelillo commented May 25, 2026

Copy link
Copy Markdown
Contributor

Handle DELETE_RECORDS in case of topics being switched from classic to diskless and/or consolidating to Tiered Storage.

@giuseppelillo giuseppelillo force-pushed the giuseppelillo/hybrid-delete-records branch 2 times, most recently from 348969f to 6afe6c7 Compare May 25, 2026 12:58
@giuseppelillo giuseppelillo requested a review from Copilot May 25, 2026 13:10

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

Adds hybrid classic→diskless handling for DeleteRecords so that, when a partition has switched, the broker can truncate the local log portion and then forward the remainder of the delete to the Inkless control plane (via DeleteRecordsInterceptor), with unit tests covering key scenarios.

Changes:

  • Updated ReplicaManager.deleteRecords to split delete requests into local vs diskless phases for hybrid partitions and to conditionally invoke the diskless interceptor.
  • Added unit tests for hybrid delete behavior (below start offset, past start offset, managed replicas on/off, and local-delete failure case).
  • Introduced a test helper to set up a leader hybrid partition with a seeded local log.

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 two-phase delete handling for hybrid partitions and routes diskless deletes through DeleteRecordsInterceptor.
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala Adds coverage for hybrid delete-records behavior and a helper to construct hybrid leader partitions for tests.

💡 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
@giuseppelillo giuseppelillo force-pushed the giuseppelillo/hybrid-delete-records branch from 6afe6c7 to e1ed1e3 Compare May 25, 2026 13:29

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

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

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala

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

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

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala
@giuseppelillo giuseppelillo marked this pull request as ready for review May 25, 2026 14:26
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
Comment thread core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala
@giuseppelillo giuseppelillo requested a review from jeqo May 26, 2026 10:55

@jeqo jeqo 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.

one last comment before approving

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
@giuseppelillo giuseppelillo requested a review from jeqo May 26, 2026 13:51
@viktorsomogyi viktorsomogyi merged commit ba468af into main May 27, 2026
5 checks passed
@viktorsomogyi viktorsomogyi deleted the giuseppelillo/hybrid-delete-records branch May 27, 2026 15:10
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