fix(inkless:switch): defer timestamp ListOffsets below the diskless log start [KC-761] #870
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #870"
general
weight: 0.35
giuseppelillo
A timestamp
ListOffsetslookup can return an offset past records that the partition still stores. The consumer then skips those records without an error.On a hybrid partition, the broker searches its local log first and asks the control plane only if nothing matches. The control plane searches from the first retained WAL batch. If the local log ends before that batch, neither search reads the offsets in between.
The following replicas hit this:
ListOffsets, and the pruner doesn't wait for replicas.Example
A born-diskless consolidating topic holds offsets 0 to 1199, with timestamps
10000 + offset. The leader has tiered up to 799, and the prune moved the WAL start to 800. Replica B is a reassignment target with an empty log. A consumer in the zone of B callsoffsetsForTimes(10100):| Replica | What happens | Consumer gets |
| --- | --- | --- |
| Leader | The local search finds offset 100. | 100 |
| B, before this change | The local search finds nothing. The control plane returns its oldest batch, 800, because its timestamp 10800 is at or past 10100. | 800, and skips 100 to 799 |
| B, after this change | The local log ends before the WAL start. |
OFFSET_NOT_AVAILABLE, and the consumer retries |Changes
The router returns the retriable
OFFSET_NOT_AVAILABLE(LEADER_NOT_AVAILABLEbefore version 5) when the local log ends before the diskless log. The Fetch path already does this for the same window. A match in the local log is still returned.FetchOffsetHandler.Job.addWalStartreads the WAL start in the same control-plane call as the timestamp lookup. The lookup fails if the local log ends before the WAL start, or before the seal if that's later.Jobnow matches responses to requests by position, because a partition can appear twice. A response for another partition fails the lookups.ConsolidationDeferredListOffsetsRate: a newReplicaManagermeter counts the deferred lookups. Errors from the control plane don't count.DISKLESS_CONSOLIDATION.mdlists it.LeaderEpochFileCache.assign(List): it validates the entries before it changes the cache, and it holds the write lock across them. A reader sees none of the restored epochs or all of them.INKLESS_OWNERSHIPlists the file as interleaved.The WAL start check applies only while the broker consolidates the partition. A switched partition that doesn't consolidate, or one in phase 1, keeps its log at the seal. There, diskless retention or a
DeleteRecordspast the seal would fail every local miss.Trade-off
A consolidating replica that can't rebuild answers timestamp lookups with
OFFSET_NOT_AVAILABLEuntil it rebuilds. This happens when the remote prefix is unknown or when the consolidation fetcher parks the partition. Before this change, the replica returned a wrong offset.ConsolidationDeferredListOffsetsRateshows a replica in this state.Testing
DisklessFetchOffsetRouterTestcovers a switched replica below the seal, with sync and async local lookups, the version mapping, and a local match. It also covers a consolidating replica before and past the WAL start, a diskless lookup that doesn't match, a search range that stops being current, the seal bound before the first prune, forwarded errors, and the fresh-job fallback.FetchOffsetHandlerTestcovers request order, positional matching, the cross-tier earliest cache, failures, and a response-count mismatch.ReplicaManagerInklessTestchecks that the KC-702 recreated leader and an empty consolidating replica getOFFSET_NOT_AVAILABLE, and that a caught-up replica gets the diskless offset. It also covers the rebuild window with no epoch for the log start, a rebuild during the lookup, and a log start that moves during the lookup. The existing fallback tests that stub the local lookup now create a local log at the seal.DisklessFetchOffsetRouterTestandReplicaManagerInklessTestcheck that each deferred lookup marksConsolidationDeferredListOffsetsRateonce, and that other answers don't.LeaderEpochFileCacheTestchecks that a reader sees none or all of a restored list of epoch entries.InklessDisklessListOffsetsTestpasses against Postgres, andRemoteLogManagerTest,UnifiedLogTest, andTierStateMachineTestpass.KC-761
🤖 Generated with Claude Code
Assisted-by: Claude Opus 5.5
[KC-761]: https://aiven.atlassian.net/browse/KC-761?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ