Skip to content

Fix read-only cache availability and read timeouts - #2782

Open
michaeljohnston-nunkiharmonia wants to merge 2 commits into
TraceMachina:mainfrom
Nunki-Harmonia:upstream/readonly-tier-existence
Open

michaeljohnston-nunkiharmonia wants to merge 2 commits into
TraceMachina:mainfrom
Nunki-Harmonia:upstream/readonly-tier-existence

Conversation

@michaeljohnston-nunkiharmonia

Copy link
Copy Markdown

What and why

A local cache backed by a shared cache that it may read but not update could report a file as missing even when the local copy was available. If the shared cache stopped replying, cache checks and reads could also wait indefinitely despite a configured rpc_timeout_s. This came up while testing reuse across fresh cache clients and failure during an upstream outage.

This change fixes the two problems:

  • When the slow tier is read_only or get, existence checks accept files in either tier and only ask upstream about local misses. Writable caches still require presence in the slow tier, so clients continue to refill it when needed.
  • The existing RPC timeout also covers ordinary requests and opening a ByteStream.Read, including connection acquisition and the first response. Forwarded reads and direct store reads, with or without compression, use the same deadline helper.

How was this verified?

On upstream 45a3b1b4, six new regressions failed: local-only availability, local hits with an unresponsive upstream, ordinary cache requests, direct reads with and without compression, and a stream that opens but delays its first chunk. The control tests passed. With the fix, all 65 tests across fast_slow_store_test, grpc_store_test, grpc_read_batching_test, and grpc_wire_compression_test passed using Bazel 9.1.1 with the repository's formatting and Clippy checks enabled.

The tests also cover duplicate keys, both supported read-only slow-tier settings, absence of upstream writes, writable-cache behavior, and a delayed read with the timeout disabled. The server build, web build, docs structure checks, Vale, and typos checks passed locally. The config reference and text exports were regenerated. Hosted CI, Windows, and sanitizer runs remain to be checked upstream; this has not been deployed upstream.

Risk

Existing deployments with a nonzero RPC timeout will now enforce it on reads that previously ignored it. Slow responses may therefore fail and retry sooner. The default remains 0 (disabled), and retries can make the overall operation take longer than one timeout interval. The timeout covers opening a read through its first response; it does not bound later chunks.

A read-only existence hit means the file is available in either tier, not that it will survive loss of the local tier. No write permissions, wire formats, or stored data formats change.

AI assistance

gpt-6-astra xhigh was used for authoring and adversarial review.

Accept local-only blobs when uploads cannot refill the slow tier. Query
only local misses upstream, while retaining durable-tier existence for
writable mirrors. Cover both read-only settings and preserve write limits.
Bound connection acquisition and the first ByteStream response for every
read route, including direct identity and compressed store reads. Retain
the existing retry loops and keep zero as the disabled timeout setting.

Exercise unresponsive endpoints, delayed first chunks, local hits during
upstream failure, and the disabled-timeout control.
@vercel

vercel Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Sep 20, 2026 5:30am UTC
nativelink-aidm Ready Ready Preview Sep 20, 2026 5:30am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – nativelink — d420a4a4 Deployed Sep 20, 2026 by vercel[bot]
Preview – nativelink-aidm — d420a4a4 Deployed Sep 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant