Skip to content

fix(object_store): re-validate rescues, cap timeout allowance, and require admission for overload copies - #229

Merged
shikhar merged 4 commits into
mainfrom
fix/replica-read-guards
Nov 20, 2026
Merged

shikhar merged 4 commits into
mainfrom
fix/replica-read-guards

Conversation

@shikhar

@shikhar shikhar commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Fixes three replica read edge cases in object_store:

  • Rescue feasibility re-validation ([Detail Bug] Replica reads: rescue copies can launch even after destination becomes infeasible, wasting copy/admission capacity #222): RoutingSnapshot::rescue_schedule now returns ScheduledRescue { after, index, budget }, carrying each rescue's schedule-time feasibility budget (download_timeout - after when scheduled healthy, or download_timeout when scheduled overloaded and therefore not pulled earlier). When Trigger::Rescue fires, Followups::next re-checks routing.feasible(rescue.index, rescue.budget) against the fresh routing snapshot. Using the schedule-time budget eliminates both schedule-vs-fire overload drift and 1 ms timer-lateness flakiness on clamped rescues.
  • Post-header timeout allowance ([Detail Bug] Replica reads: bucket timeouts after headers may never count as failures, preventing deprioritization #223): When both first_byte and body tails are measured and body <= request.tail (at max(requested_bytes, announced_body_bytes)), LatencyModel::timeout_allowance caps their sum at request.tail.max(first_byte). This prevents anticorrelated or independent phase tails (and unfinished slow headers) from turning post-header bucket timeouts into unreachable Outcome::Neutral verdicts, while letting small announced bodies on page reads tighten below request.tail and preserving the full first_byte + body sum for rare or extrapolated large bodies (body > request.tail). When either phase is unmeasured, the floor falls back to request.tail(requested_bytes) if announced_body_bytes is past a flat model's reach.
  • Overload retry credit conservation ([Detail Bug] Downloader: overload fallback can burn a retry credit without sending any request #224): Overload-triggered copies (routing.all_overloaded()) now require an immediate admission permit before calling attempt_budget.try_retry(), so they never queue in BucketOperation::execute and burn a retry credit on AdmissionTimeout or cancellation. Recovery probe backups reuse their reserved backup_admission, and untried overload fallbacks rejected by try_acquire record DownloadError::AdmissionTimeout so a prior replica NoSuchKey cannot surface as a false 404.
  • Docs: Rewrote docs/replica-reads.md for clarity and accuracy.

Verification

  • cargo +nightly fmt
  • cargo clippy --locked --all-features --all-targets -- -D warnings --allow deprecated
  • cargo deny check
  • cargo nextest run --locked (including unit tests covering all three fixes and review follow-up edge cases)
  • Full release simulation campaign (main vs. branch across all 54 scenarios × 3 seeds = 162 runs, 271,113 arrivals): 54/54 identical with zero regressions

Closes #222
Closes #223
Closes #224

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

This PR tightens replica reads and rewrites their documentation.

  • Replica rescues check their original time budget before they launch.
  • Timeout allowances keep measured phase tails aligned with request latency.
  • Overloaded replica copies need admission before spending retry credit.

The latest changes preserve these rules across overload changes and flat request models. No new actionable issues were found. Tests were inspected, not run.

Reviews (2) · Last reviewed commit: "test(object_store): clarify timeout allo..." · Reviewed by Greptile

@shikhar
shikhar merged commit 9acda1a into main Nov 20, 2026
8 checks passed
@shikhar
shikhar deleted the fix/replica-read-guards branch November 20, 2026 15:56
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
shikhar pushed a commit that referenced this pull request Nov 20, 2026
## 🤖 New release

* `cachey`: 0.13.5 -> 0.13.6

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.13.6](0.13.5...0.13.6)
- 2026-11-20

### Fixed

- *(service)* reject objects exceeding MAX_OBJECT_SIZE
([#230](#230))
- *(object_store)* re-validate rescues, cap timeout allowance, and
require admission for overload copies
([#229](#229))
- *(service)* bound max_attempts in C0-Config and retry overrides
([#228](#228))

### Other

- *(deps)* upgrade dependencies
([#226](#226))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant