← Back to Pull requests

fix(inkless:switch): route pending-upload offsets to the classic log #861

Closed
unknown closed this pull request without merging on Nov 09, 2026 15:30 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 10:15 UTC
Author

Router fix

A follower with follower.fetch.last.tiered.offset.enable=true asks the leader for EARLIEST_PENDING_UPLOAD_TIMESTAMP before it rebuilds from tiered storage. Only the local UnifiedLog knows that offset, which derives from the highest offset in remote storage and the log start offset. A follower request on a switched partition takes the direct classic route. A diskless topic with remote storage whose switch is pending has no committed seal, and the router already applies the consolidating rules to it, so its follower requests take the hybrid route while the classic fetcher still replicates the prefix. There DisklessFetchOffsetRouter sent the request to the diskless lookup first and fell back to the classic log only on an empty answer. The router now routes the timestamp to the classic lookup, like EARLIEST_LOCAL_TIMESTAMP and LATEST_TIERED_TIMESTAMP.

The router picks one of four cases per partition and checks them in the order 3, 4, 2, 1. The fix changes only case 2. How a request for EARLIEST_PENDING_UPLOAD_TIMESTAMP routes in each case:

  • Case 1, pure diskless: no preceding case matches. The topic never switched and has no remote storage, or managed replicas are off. The router sends every timestamp to the diskless lookup. Unchanged. No follower fetches such a partition, so this request doesn't arrive.

  • Case 2, hybrid: the partition is switched with managed replicas on, or the topic is diskless with remote storage. The router picks the leg by timestamp. Before the fix this request went to the diskless lookup first and fell back to the classic log on an empty answer. Now it goes straight to the classic lookup. This case covers a tiered diskless topic whose switch is pending and a consolidating topic without a committed seal.

  • Case 3, pending switch without remote storage: the switch is pending, managed replicas are on, and the topic has no remote storage. The router sends every timestamp to the classic lookup, and the request never reaches diskless. Unchanged.

  • Case 4, follower on a switched partition: the seal is committed, managed replicas are on, and the request carries a replica ID. The router sends every timestamp to the classic lookup. Unchanged. After the switch completes, a follower takes this path, so the fix has no effect on a completed switch.
  • Docs

    CLASSIC_TO_DISKLESS_SWITCH.md described a follower that consolidated on a release that didn't wait for phase 2, and the resulting segment that spans the seal, as a limitation of forced deletion. On the current code forceDeleteLocalSegmentsBelow rolls the active segment before it deletes, applyDelta runs it before consolidation starts, Partition.seal() rolls the leader, and a log directory move rolls the future log at the seal. The section drops that scenario and keeps the remote-storage-off caveat.

    Testing

  • DisklessFetchOffsetRouterTest covers the hybrid route, a follower request on a tiered diskless topic whose switch is pending, and a consolidating topic without a committed seal.

  • make vale reports no alerts.
  • Assisted-by: Claude Fable 5.1

    Diff: 388 lines (+291 / -97) across 4 files Reviewer: viktorsomogyi Review duration: 315m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 388 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #861"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%
    Repository