fix(inkless:consolidation): skip the diskless supplement when the local read ends mid-batch [KC-876] #911
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.315
Real PR Conversation Timeline
1 comments
"Review active on #911"
general
weight: 0.35
viktorsomogyi
Why
A byte-limited local read of a consolidating partition can end inside a batch. The batch iterator drops that partial tail, so the supplement starts at the partial batch's base offset. The merge still keeps the partial bytes, so the response holds a truncated batch in front of the diskless batches. The consumer reads the partial header, runs into the diskless bytes, and fails the CRC check.
The local log isn't frozen at the seal, because the consolidation fetcher keeps appending to it. The log end offset that
DelayedFetchcaptures at routing can therefore be stale, which lets the exhaustion guard pass.The committed data isn't lost, but the consumer can't make progress until a later fetch avoids the same shape.
What changes
buildConsolidationSupplementFetchInfosskips the supplement when the complete batches don't account for all local bytes. The partial batch then stays the last thing in the response, where it's harmless, and the consumer re-fetches from the last complete batch.This change doesn't move the log end offset that
DelayedFetch.onCompleteuses. That idea from the ticket is a separate change.Test plan
testBuildConsolidationSupplementFetchInfosSkipsWhenLocalReadEndsMidBatchtoReplicaManagerInklessTest. The test fails without the guard and passes with it.ReplicaManagerInklessTest(321 tests) andDelayedFetchTest(5 tests) with no failures.make valewith no alerts.Fixes KC-876.
🤖 Generated with Claude Code