Skip to content

fix(inkless:consolidation): complete the classic-to-consolidated switch by always sealing and registering - #651

Merged
giuseppelillo merged 1 commit into
mainfrom
svv/ts-unification-seal-fix
Jun 29, 2026
Merged

fix(inkless:consolidation): complete the classic-to-consolidated switch by always sealing and registering#651
giuseppelillo merged 1 commit into
mainfrom
svv/ts-unification-seal-fix

Conversation

@viktorsomogyi

Copy link
Copy Markdown
Contributor

A switch-pending partition must take the seal+register branch in ReplicaManager.applyLocalLeadersDelta even when the topic is already a consolidating diskless topic. Otherwise consolidation claims the partition and the classic log is never sealed, leaving classicToDisklessStartOffset stuck at CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked.

@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-remote-read branch 2 times, most recently from cff8f1d to 51a1ede Compare June 22, 2026 10:58
Base automatically changed from svv/ts-unification-remote-read to main June 22, 2026 13:46
@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-seal-fix branch from a766057 to e6c7bf6 Compare June 23, 2026 08:11
@viktorsomogyi
viktorsomogyi requested a review from Copilot June 23, 2026 08:11

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 a deadlock in the classic-to-diskless switch path for consolidating diskless topics by ensuring that, while the switch seal is still pending, the leader always takes the seal+register path (instead of the consolidating become-leader path that would skip sealing).

Changes:

  • Update ReplicaManager.applyLocalLeadersDelta to route “pending switch of an already-online partition” to the seal+register branch even when the topic is already marked consolidating.
  • Add a regression test that exercises the real two-delta sequence (pending switch → seal commit) and asserts the correct ordering: seal+register first, then consolidation fetcher start after commit.

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/ReplicaManager.scala Adds an explicit guard so pending classic-to-diskless switches on consolidating topics seal+register before consolidation can start.
core/src/test/scala/unit/kafka/server/ReplicaManagerInklessTest.scala Adds a focused regression test covering the pending-switch leader path and subsequent seal-commit transition into consolidation.

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

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 no new comments.

@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-seal-fix branch from e6c7bf6 to 497bc4c Compare June 23, 2026 09:36
@viktorsomogyi
viktorsomogyi marked this pull request as ready for review June 23, 2026 09:36
@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-seal-fix branch from 497bc4c to 7295635 Compare June 26, 2026 14:01
…ch by always sealing and registering

A switch-pending partition must take the seal+register branch in
ReplicaManager.applyLocalLeadersDelta even when the topic is already a
consolidating diskless topic. Otherwise consolidation claims the partition and
the classic log is never sealed, leaving classicToDisklessStartOffset stuck at
CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
@viktorsomogyi
viktorsomogyi force-pushed the svv/ts-unification-seal-fix branch from 956985c to 122346e Compare June 29, 2026 08:31
@giuseppelillo
giuseppelillo merged commit dd5457c into main Jun 29, 2026
4 checks passed
@giuseppelillo
giuseppelillo deleted the svv/ts-unification-seal-fix branch June 29, 2026 12:46
giuseppelillo pushed a commit that referenced this pull request Jun 29, 2026
…ch by always sealing and registering (#651)

A switch-pending partition must take the seal+register branch in
ReplicaManager.applyLocalLeadersDelta even when the topic is already a
consolidating diskless topic. Otherwise consolidation claims the partition and
the classic log is never sealed, leaving classicToDisklessStartOffset stuck at
CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
giuseppelillo pushed a commit that referenced this pull request Jun 29, 2026
…ch by always sealing and registering (#651)

A switch-pending partition must take the seal+register branch in
ReplicaManager.applyLocalLeadersDelta even when the topic is already a
consolidating diskless topic. Otherwise consolidation claims the partition and
the classic log is never sealed, leaving classicToDisklessStartOffset stuck at
CLASSIC_TO_DISKLESS_SWITCH_PENDING and the switch deadlocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
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