fix(inkless:consolidation): reject follower reads below the cross-tier earliest [KC-332] - #720
Merged
Merged
Conversation
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 23, 2026 09:59
52cf871 to
8a1d7f2
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-reclaim-floor
branch
from
July 23, 2026 15:37
86e3b1a to
a6f0a03
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 23, 2026 15:39
8a1d7f2 to
9a10866
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-reclaim-floor
branch
2 times, most recently
from
July 23, 2026 15:47
bbca8b1 to
f6c0f80
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 23, 2026 15:49
9a10866 to
8a6d2c9
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-reclaim-floor
branch
from
July 24, 2026 12:17
f6c0f80 to
e3f351d
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 24, 2026 12:17
8a6d2c9 to
0982191
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-reclaim-floor
branch
from
July 24, 2026 13:07
e3f351d to
5079dcd
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
3 times, most recently
from
July 27, 2026 10:37
771e660 to
dda940f
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 28, 2026 08:52
dda940f to
96ef5b2
Compare
viktorsomogyi
marked this pull request as ready for review
July 28, 2026 08:53
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the consolidating diskless-topic fetch path by preventing consumer fetches routed to follower replicas from reading offsets below the authoritative (control-plane) cross-tier earliest offset, avoiding exposure of logically-deleted records after classic→diskless switches.
Changes:
- Add a follower-only guard in
ReplicaManager.fetchMessagesto returnOFFSET_OUT_OF_RANGEwhen a consumer fetch offset is below the cross-tier earliest (fail-open when unresolved). - Add unit tests covering follower/leader behavior, modern vs older consumers (client metadata), and fail-open behavior when the earliest cannot be resolved.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| core/src/main/scala/kafka/server/ReplicaManager.scala | Adds the cross-tier-earliest guard for consumer fetches routed to follower replicas during consolidation. |
| core/src/test/scala/unit/kafka/server/ReplicaManagerInklessTest.scala | Adds unit tests validating rejection/allow rules and fail-open behavior for the new guard. |
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 28, 2026 10:02
96ef5b2 to
8ecdaa8
Compare
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 28, 2026 10:41
8ecdaa8 to
762c659
Compare
giuseppelillo
previously approved these changes
Jul 28, 2026
giuseppelillo
enabled auto-merge (squash)
July 28, 2026 12:47
jeqo
disabled auto-merge
July 28, 2026 12:48
Contributor
|
@viktorsomogyi check
|
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 28, 2026 12:51
762c659 to
692f42e
Compare
Contributor
Author
|
@jeqo sorry for that, fixed it now |
ivanyu
previously approved these changes
Jul 28, 2026
…r earliest [KC-332] Followers keep a stale local logStartOffset (frozen at the seal) after a switch, so an older consumer routed there could read logically-deleted records. Consult the control-plane cross-tier earliest and reject such fetches with OFFSET_OUT_OF_RANGE (fail-open when unavailable). Adds unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Looking at the test failures already. First they didn't appear on my local branch, just after rebasing it on |
viktorsomogyi
force-pushed
the
svv/ts-unification-follower-reads
branch
from
July 28, 2026 13:46
692f42e to
ed0554d
Compare
Contributor
Author
ivanyu
approved these changes
Jul 28, 2026
giuseppelillo
pushed a commit
that referenced
this pull request
Jul 29, 2026
…r earliest [KC-332] (#720) * fix(inkless:consolidation): reject follower reads below the cross-tier earliest [KC-332] Followers keep a stale local logStartOffset (frozen at the seal) after a switch, so an older consumer routed there could read logically-deleted records. Consult the control-plane cross-tier earliest and reject such fetches with OFFSET_OUT_OF_RANGE (fail-open when unavailable). Adds unit tests. Co-authored-by: Cursor <cursoragent@cursor.com> * fixup(inkless:consolidation): mock ReplicaManager for tests --------- Co-authored-by: Cursor <cursoragent@cursor.com>
giuseppelillo
pushed a commit
that referenced
this pull request
Jul 30, 2026
…r earliest [KC-332] (#720) * fix(inkless:consolidation): reject follower reads below the cross-tier earliest [KC-332] Followers keep a stale local logStartOffset (frozen at the seal) after a switch, so an older consumer routed there could read logically-deleted records. Consult the control-plane cross-tier earliest and reject such fetches with OFFSET_OUT_OF_RANGE (fail-open when unavailable). Adds unit tests. Co-authored-by: Cursor <cursoragent@cursor.com> * fixup(inkless:consolidation): mock ReplicaManager for tests --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followers keep a stale local logStartOffset (frozen at the seal) after a switch, so an older consumer routed there could read logically-deleted records. Consult the control-plane cross-tier earliest and reject such fetches with OFFSET_OUT_OF_RANGE (fail-open when unavailable). Adds unit tests.