Repository navigation
docs(adr): record proxy-warming vs origin-only policy composition (#1990) - #2055
Merged
Merged
Conversation
) Two deliberate policies interact in a way neither ADR documented: the client's cold-blob / warming fallback (ADR 037) targets RTT-nearest non-holders, and an origin-configured node defaults to origin-only (`relay_foreign_namespaces = false`, #1759) and declines a foreign miss. The fallback can therefore route a warming attempt to a node that categorically declines it. Run through spec discipline, the two policies compose correctly rather than conflict: proxy warming is a relay-edge mechanism by construction, and an origin-only node declining a warming pull is the origin-only policy holding, not a warming failure. The decline collapses to `NotFound`, the client fails over over the shared pool at the cost of one round-trip, and pays nothing. Document the composition: - ADR 037 gains a "Warming is a relay-edge mechanism" section and a Cross-ADR Impact bullet for ADR 002. - ADR 002 § Retrieval by namespace gains the canonical statement of the `relay_foreign_namespaces` role-derived policy (previously code-only, referenced obliquely by ADR 041 as "a separate policy"). No mechanism is added. The two options that would (a self-attested probe flag to pre-filter origin-only nodes, and reversing the #1759 default) stay out — both add surface to force an optimization that is correctly not firing. The interaction is already observable: the serving node counts declines in `decdn_serve_stream_rejected_foreign_declined_total` (exists since #1766) and the client logs its warming lead and each failover; the client is an ephemeral CLI with no scrape endpoint, so a client-side counter would be dead instrumentation. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The new ADR 037 text incorrectly states the probe has_blob answer is unsigned (it is signed), and ADR 002 wording risks implying the serve/decline decision is based on namespaceId rather than backend-authoritative presence.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Documents how ADR 037 proxy-warming composes with the ADR 002 origin-only (cache.relay_foreign_namespaces) policy, clarifying that origin-only nodes declining warming pulls is expected behavior (and observable via existing metrics/logs).
Changes:
- Add a new “Warming is a relay-edge mechanism” section to ADR 037, plus an explicit cross-ADR impact bullet referencing ADR 002.
- Add a canonical description of
cache.relay_foreign_namespacesrole-derived defaults and decline semantics to ADR 002’s “Retrieval by namespace” section.
File summaries
| File | Description |
|---|---|
| adr/037-regional-proxy-warming.md | Adds explicit composition/observability text for proxy warming vs. origin-only relay policy. |
| adr/002-content-addressing.md | Documents cache.relay_foreign_namespaces policy defaults and how declines surface on the wire. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…review)
Two accuracy fixes from PR review:
- ADR 037 said the probe `has_blob` answer is "unsigned"; it is signed
(EIP-712 `slash_sig` over `{hash, has_blob, rate_per_mb, timestamp_us}`).
The real point is that `ProbeResponse` carries no policy/role field, so a
client cannot tell an origin-only node from a relay edge — reworded to say
exactly that.
- ADR 002 described the origin-only decline in namespace terms, risking the
implication that `namespaceId` drives the serve/decline decision. The gate
is backend-authoritative (`origin_probe_presence(hash)`) and never consults
`namespaceId`, which stays a routing hint (#1525). Reworded to backend
presence and stated the non-consultation explicitly.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1990.
What
#1990 flags an undocumented interaction between two deliberate policies:
relay_foreign_namespaces = false) and declines a foreign-namespace miss before any fill tier.A
has_blob: falseprobe answer is identical on the wire for an origin-only node and a relay edge, so the client's fallback can route a warming attempt to a node that categorically declines it.Decision (from spec discipline)
Ran all three options from the issue through
decdn-spec-discipline. The sharper finding: the two policies compose correctly — there is no conflict to resolve. Proxy warming is a relay-edge mechanism by construction; an origin-only node declining a warming pull is #1759 functioning, not a warming failure. The decline collapses toNotFound, the client fails over over the shared pool at the cost of one round-trip, and pays nothing.The two options that would add a mechanism stay out, each failing a gate:
Changes (documentation only)
### Warming is a relay-edge mechanismsection and a Cross-ADR Impact bullet for ADR 002.relay_foreign_namespacesrole-derived policy — previously code-only, referenced obliquely by ADR 041 as "a separate policy, outside this decision."Present-tense canon; no mechanism added.
On the "add counters" ask
The observability the issue asks for already exists where a counter is meaningful, so no new counter is added:
decdn_serve_stream_rejected_foreign_declined_totalis defined, wired to the decline path (wire.rs), and tested (metrics.rs) — added with feat(node): origin-only node policy — decline foreign relay via cached backend probe (#1759) #1766. This is the population-level signal ("how often origin-only policy fires"). The issue's "no counter on either side" is stale for the node.decdn fetch/bundle pull); the daemon's miss-leg does a plain holder pull, never warming.decdn fetchis an ephemeral one-shot with no/metricsendpoint, so a Prometheus counter there would be dead instrumentation (fails the enforcement / live-consumer gates). The client events are already logged: warming-leadinfo!, cold-fallbackinfo!, decline→failoverwarn!.The new ADR text points at exactly these — the decline counter and the client logs — as the answer to the issue's "nothing measures" concern.
Verification
make -C adr check-refs— passes (all anchor links resolve, no bare refs)markdownlint— passes🤖 Generated with Claude Code