fix(inkless:consolidation): don't supplement an empty local read of a consolidating partition [KC-848] #907
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 480 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #907"
general
weight: 0.35
giuseppelillo
Summary
A lagging consumer of a consolidating partition can skip committed records without an error. The broker may answer a fetch inside the local log with records that start at the local log end offset instead of the fetch offset. This happens when the local read comes back empty with no error. An earlier partition in the request can use up the byte budget and cause that read.
buildConsolidationSupplementFetchInfosanchored the diskless supplement for that read at the log end offset, so the exhaustion guard passed. The consumer then moved pastfetchOffset, logEndOffset).buildConsolidationSupplementFetchInfosnow anchors an empty read at the fetch offset. The guard then drops the supplement, and the consumer fetches again from its own offset. It also skips a partition whose local read returns a preferred read replica or a remote storage redirect. Both fetch paths call the helper. The change also coversDelayedFetch.onComplete, which has none of the inline path's guards.Follow-ups, not in this change:
DelayedFetch.onCompleteissues the supplement without checkingminBytesagain.DISKLESS_CONSOLIDATION.mdnow states this behavior.fetchParamsWithNewMaxBytesgives every leg of a mixed fetch the full byte budget.Evidence
DelayedFetch.onCompleterequests a supplement for both consolidating partitions. The second partition's local read is empty, and its response starts at the log end offset.After: only the first partition gets a supplement. The second partition's response is empty, and the consumer fetches again from its offset.
ReplicaManager, the three newDelayedFetchTesttests and four newbuildConsolidationSupplementFetchInfostests fail.testBuildConsolidationSupplementFetchInfosSkipsEmptyLocalReadBelowLogEndOffsetreplaces the test that pinned the old behavior. It asserts that the helper doesn't emit a supplement.testCompletionWithConsolidationSupplementuses a local read that reaches the log end offset, so it still covers the merge.DelayedFetchTestandReplicaManagerInklessTestpass with 338 tests.ReplicaManagerTestpasses with 129 tests.:core:checkstyleTestpasses, andmake valedoesn't report alerts on the added lines.Merge danger
Door: two-way
The change touches only the broker fetch path. It doesn't write state or change a protocol or config. A revert restores the previous behavior.
Blast radius: consolidating partitions
Only consumer fetches of consolidating partitions that start inside the local log change. After an empty local read, the response for that partition used to contain a supplement. It's now empty. The consumer fetches again, so a lagging consumer can take more round trips to catch up. Classic partitions, pure diskless partitions, and follower fetches don't change.
🤖 Generated with [Claude Code
Assisted-by: Claude Sonnet 5.5
Assisted-by: Claude Opus 5.5