Repository navigation
fix(inkless:switch): advance the leader's local log start past the seal on DeleteRecords [KC-880] - #927
Merged
Conversation
viktorsomogyi
force-pushed
the
svv/kc-880-leader-serves-deleted-past-seal
branch
from
December 2, 2026 12:43
792f00f to
1e86a36
Compare
| waitUntilTrue(() => responseData.nonEmpty, "Lagging switched consolidating delete records response was not completed") | ||
| assertEquals(Errors.NONE.code, responseData(disklessTopicPartition.topicPartition()).errorCode) | ||
| assertEquals(150L, responseData(disklessTopicPartition.topicPartition()).lowWatermark) | ||
| assertEquals(120L, partition.localLogOrException.logStartOffset) |
Contributor
There was a problem hiding this comment.
The PR body says a leader whose local high watermark is below X "stops there, and its consolidation fetch resets it to X". This test stops at logStartOffset == 120. No test covers the step from 120 to 150.
That step depends on several pieces lining up:
find_batchesreturnsoffset_out_of_rangeat 120.DisklessLeaderEndPoint.fetchreportsmin(crossTier, localLog.logStartOffset)= 120 as the log start, and returnsOFFSET_OUT_OF_RANGEbecausecrossTier >= disklessStartOffset.fetchOffsetAndTruncatethen getsEARLIEST= 150 and callstruncateFullyAndStartAt(150).
The existing endpoint test for that branch, testFetchResetsBelowSealBeforeFirstPruneWhenPrefixIsDeleted, uses a local log start of 0, below the seal. The state this PR creates, with the local log start above the seal and below the cross-tier earliest, isn't exercised.
Contributor
Author
There was a problem hiding this comment.
Good catch, your trace is right. I added two tests in dc037e3:
DisklessLeaderEndPointTest.testFetchResetsAboveSealWhenDeleteRecordsPassedLaggingLeadercovers the endpoint in the state this PR creates: local log start 120, seal 100, WAL start and cross-tier earliest 150, andfind_batchesreturningOFFSET_OUT_OF_RANGEat 120. It returnsOFFSET_OUT_OF_RANGEwith log start 120 and doesn't consult RLMM.ConsolidationFetcherThreadTest.testLaggingLeaderResetsToCrossTierEarliestAfterDeleteRecordsPastSealdrives the realConsolidationFetcherThreadandDisklessLeaderEndPointthrough onedoWork()and checkstruncateFullyAndStartAt(150). The local LEO is 120, not 0, soshouldFetchFromLastTieredOffsetis false and the fetcher takes the plainEARLIESTreset.
viktorsomogyi
force-pushed
the
svv/kc-880-leader-serves-deleted-past-seal
branch
from
December 2, 2026 15:59
1e86a36 to
dc037e3
Compare
…al on DeleteRecords [KC-880] On a switched consolidating partition, DeleteRecords with an offset above the seal cut the leader's local log only at the seal. The leader's local log also holds the consolidated range from the seal up to its high watermark, and its consumer fetch is gated only by the local log start. The leader kept serving the deleted range while ListOffsets(EARLIEST) and every follower already rejected it. The local leg now deletes up to the requested offset, capped at the local high watermark and never below the seal. A lagging leader stops at its high watermark, and its consolidation fetch later resets to the cross-tier earliest. Without consolidation the local log ends at the seal, so the behavior there doesn't change. ## Test plan - Add `ReplicaManagerInklessTest` cases for a delete past the seal and for a delete past the leader's local high watermark. Both fail without the fix. - Run the full `ReplicaManagerInklessTest` suite: 297 tests pass. Assisted-by: Claude Opus 5.5
…cords past the seal [KC-880] A leader whose local high watermark is below the DeleteRecords offset cuts its local log at the high watermark, past the seal. Its next consolidation fetch has to reset it to the cross-tier earliest. Nothing exercised the endpoint with a local log start between the seal and the cross-tier earliest, or the fetcher reset that follows. ## Test plan - Add a `DisklessLeaderEndPointTest` case for that state: the endpoint returns `OFFSET_OUT_OF_RANGE` without consulting RLMM. - Add a `ConsolidationFetcherThreadTest` case that drives the real fetcher thread and endpoint through one `doWork()` and checks `truncateFullyAndStartAt` at the cross-tier earliest. Assisted-by: Claude Opus 5.5
viktorsomogyi
force-pushed
the
svv/kc-880-leader-serves-deleted-past-seal
branch
from
December 3, 2026 10:30
dc037e3 to
24f13a4
Compare
giuseppelillo
approved these changes
Dec 3, 2026
giuseppelillo
enabled auto-merge (squash)
December 3, 2026 10:35
This was referenced Dec 3, 2026
This was referenced Dec 3, 2026
gqmelo
added a commit
that referenced
this pull request
Dec 3, 2026
On 4.3, `ConfigurationControlManager#incrementalAlterConfig`, `incrementalAlterConfigs`, and `legacyAlterConfigs` take a `forwarded` flag. The tests added by #899 used the main signatures, so they now pass `false`. The #927 test in `ConsolidationFetcherThreadTest` mocks `LogConfig`. On main, an earlier main-only change already imports it, so the cherry-pick adds the import. After these picks, `kafka.server.ReplicaManager` on 4.3 is too big for SpotBugs, and `:core:spotbugsMain` fails with `SKIPPED_CLASS_TOO_BIG`. The exclude filter skips that pattern for `ReplicaManager` only, as `inkless-4.1` has done since 0.51. Assisted-by: Claude Opus 5.5
gqmelo
added a commit
that referenced
this pull request
Dec 4, 2026
…branch 0.53 is the first release of `inkless-4.4`, so the branch joins the active table in `RELEASES.md`. The cherry-pick guide now places main at the 4.4 branch point and records the adaptations of this round: the SpotBugs exclude on 4.3, and the `forwarded` argument and the reassignment completion rule on 4.2 and 4.1. `ca375e2131` reached `main` inside the upstream sync merge #897, so `branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3 release-prep PRs failed `Compile and Check Java` without it. The guide now shows how to find Inkless commits inside a sync merge. The 4.1 session log first listed the hashes of the release-branch cherry-picks. The session template and the guide's agent prompt now ask for the hashes of the commits on main, as the other logs list them. The session logs record the cherry-pick of #882 through #927 to `inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through #927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the 4.3 jOOQ fix. Assisted-by: Claude Opus 5.5
jeqo
pushed a commit
that referenced
this pull request
Dec 4, 2026
…branch (#939) 0.53 is the first release of `inkless-4.4`, so the branch joins the active table in `RELEASES.md`. The cherry-pick guide now places main at the 4.4 branch point and records the adaptations of this round: the SpotBugs exclude on 4.3, and the `forwarded` argument and the reassignment completion rule on 4.2 and 4.1. `ca375e2131` reached `main` inside the upstream sync merge #897, so `branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3 release-prep PRs failed `Compile and Check Java` without it. The guide now shows how to find Inkless commits inside a sync merge. The 4.1 session log first listed the hashes of the release-branch cherry-picks. The session template and the guide's agent prompt now ask for the hashes of the commits on main, as the other logs list them. The session logs record the cherry-pick of #882 through #927 to `inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through #927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the 4.3 jOOQ fix. Assisted-by: Claude Opus 5.5
viktorsomogyi
pushed a commit
that referenced
this pull request
Dec 4, 2026
…branch (#939) 0.53 is the first release of `inkless-4.4`, so the branch joins the active table in `RELEASES.md`. The cherry-pick guide now places main at the 4.4 branch point and records the adaptations of this round: the SpotBugs exclude on 4.3, and the `forwarded` argument and the reassignment completion rule on 4.2 and 4.1. `ca375e2131` reached `main` inside the upstream sync merge #897, so `branch-consistency.sh` didn't list it, and the 4.1, 4.2, and 4.3 release-prep PRs failed `Compile and Check Java` without it. The guide now shows how to find Inkless commits inside a sync merge. The 4.1 session log first listed the hashes of the release-branch cherry-picks. The session template and the guide's agent prompt now ask for the hashes of the commits on main, as the other logs list them. The session logs record the cherry-pick of #882 through #927 to `inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, and of #911 through #927 to `inkless-4.4`, with the follow-up pick of `ca375e2131` and the 4.3 jOOQ fix. Assisted-by: Claude Opus 5.5
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.
Summary
On a switched consolidating partition,
DeleteRecordspast the seal now moves the leader's local log start up to the requested offset instead of leaving it at the seal.Evidence
ReplicaManagerInklessTestcases fail onmain:ReplicaManagerInklessTestsuite passes (297 tests).Merge Danger
Door: two-way
Reverting restores the old cut at the seal. The extra local records this removes on the leader were already deleted by the same request: in the WAL, and from
EARLIESTon every broker.Blast Radius: narrow
Only
DeleteRecordson switched partitions with an offset above the seal is affected. Without consolidation, the local log ends at the seal, so the result is unchanged. A leader whose local high watermark is belowXstops there, and its consolidation fetch resets it toX.🤖 Generated with Claude Code