Skip to content

design: cold-blob non-holder fallback targets nodes whose default relay_foreign_namespaces refuses it — ADR 037 warming vs ADR 002 origin-only policy is undocumented #1990

Closed

Description

@yigitdot

Two deliberate policies interact in a way neither ADR mentions. Not a confirmed bug — an undocumented interaction that needs a recorded decision. Verified against main @ 8b437de.

The two policies

Client side (ADR 037 / #1911). crates/cli/src/commands/fetch.rs:526-529: when no probed node holds the blob, the client falls back to reachable non-holders — RTT-nearest first (failover_order, fetch.rs:621-642) — as pull-through serve targets. The comment: "a cold blob is origin-only with zero cache holders, the normal first-fetch state".

Node side (ADR 002 / #1759). crates/node/src/handlers/client/dispatch.rs:362-386: when relay_foreign_namespaces is false, the node asks its own backend whether it holds the hash and declines with ForeignNamespaceDeclined if not — before any fill tier, and above the cache-hit branch ("the policy is categorical rather than foreign misses only", :348-351). Its default is role-derived (crates/common/src/config/mod.rs:1958-1963): unwrap_or(origins.is_empty()) — a node with an origin configured defaults to refusing. Additionally, tier (d) window pull-through needs node_to_node_pull_through_enabled, default false (:1955-1957).

The interaction

has_blob: true on a probe means store-held or servable from own origin (crates/node/src/handlers/probe.rs:851-868, fold_origin_held). So an origin operator whose backend has the hash answers true and is filed as a holder. An origin operator whose backend lacks it answers false — and lands in exactly the non_holders bucket the client falls back to, where its default config refuses.

The fallback preferentially targets the population configured to decline it. Cache-only nodes (origins.is_empty() → gate open) still serve, via buffered try_pull_through (dispatch.rs:1041) when tier (d) is off.

No exemption is possible: StreamRequest (crates/protocol/src/client.rs:189-219) carries hash, namespace_id, pool_id, byte_offset, byte_len, timestamp_us — a warming request is indistinguishable from any other on the wire.

Impact

Degradation, not a break: ForeignNamespaceDeclined collapses to NotFound (handlers/client/mod.rs:723-728), the client fails over, no loop, no wasted payment. But each such attempt is a burned candidate, and ADR 037 proxy warming never engages against an origin-configured neighbour. Whether warming works at all depends on the cache-only share of the operator population, which nothing measures.

The fallback event is logged only at opt-in info! (fetch.rs:538-547); there is no counter on either side.

Decision needed

Options, not recommendations:

  1. Document the interaction in ADR 037 § Node serving and ADR 002 § origin-only policy, and accept that warming engages only against relay-edge nodes.
  2. Have the client skip known-origin operators as warming candidates — but the client has no signal for that today; region is self-attested and has_blob: false is exactly the ambiguous answer.
  3. Reconsider the role-derived default so an origin node relays by default and opts out — a policy reversal of Foreign-namespace relay opt-out: origin-only node policy #1759 that needs its own case.

Related: #1758 (egress-aware sourcing for own-namespace content) is the sibling economics question and does not cover this.

Activity

  1. added
    design:missing-decision
    design:adr
    prio:medium
    area:cli
    area:node
    on Sep 11, 2026
  2. alpergundogdu commented on Sep 18, 2026

    @alpergundogdu
    Contributor

    Decision: Option 1 — document as correct composition (not an accepted limitation)

    Ran the three options through spec discipline (burden of proof on adding a mechanism). The sharper finding is that the two policies already compose correctly — there is no conflict to resolve.

    The reframe: proxy warming an origin-only node with foreign content would violate #1759, whose premise is "an origin is not a general proxy." So an origin-configured node declining a warming pull is #1759 functioning as designed, not a failure the fix must route around. Proxy warming is intrinsically a relay-edge mechanism — its target population is exactly the cache-only nodes that default relay_foreign_namespaces = true. That composition is coherent by construction.

    Against the one-sentence test ("what specific failure does a fix prevent?") the interaction comes up near-empty: no loop, no wasted payment, correct result. The only cost is one wasted dial+request round-trip before the client fails over — which the existing shared-pool failover (#1174/#1773) already absorbs cheaply.

    Why not 2 or 3

    Option 3 (reverse the #1759 default so origin nodes relay by default) — keep out. Reverses a deliberate shipped policy to make an optimization fire; produces a surprise egress bill for every origin operator (the exact economics #1759 protects). It doesn't even work alone: node_to_node_pull_through_enabled also defaults false, so it needs two default flips. Forcing foreign caching onto nodes that explicitly opted out contradicts the policy this issue is trying to reconcile.

    Option 2 (client skips known-origin operators via an advertised flag) — keep out. The issue itself notes the signal doesn't exist; creating one is new self-attested wire surface (a node can lie either way) purely to save one round-trip on an optimization. And it's redundant: the node already signals its policy — by declining. You don't need a flag to predict the decline; you can observe it.

    What to actually do

    1. Document the composition — one cross-referenced paragraph in ADR 037 § Node serving and ADR 002 § origin-only policy, present-tense canon: proxy warming is a relay-edge mechanism by construction; an origin-only node declining a foreign warming pull is Foreign-namespace relay opt-out: origin-only node policy #1759 functioning; the cold-blob fallback that targets it costs one round-trip and self-corrects via failover.

    2. [optional, cheap] Two counters — the one legitimate gap the issue names is "whether warming works depends on the cache-only share, which nothing measures." Client-side warming_candidate_declined / warming_engaged and node-side foreign_namespace_declined close that so the "still fine at scale?" question is data-driven. This is observability, not protection — it enforces nothing and binds no one. The dashboard suite from feat(monitoring): four-dashboard observability suite over metrics, logs and traces #2046 can display it.

    Deferred (do not build now)

    The clever fix for the wasted round-trip needs no new wire surface and no policy change: a warming attempt that returns NotFound is already fully observable to the client. Once the persisted per-peer map lands (still spec+plan; no such code exists today), the client records "peer P declined a warming pull" and deprioritizes P as a warming lead — trustless in the clean shape (the client's own memory of observed behavior, for its own optimization; a lying node only forfeits warming traffic it opted out of). But run through the one-sentence test it's marginal (saves one round-trip on a subsequent fetch) and a transient backend fault shouldn't permanently demote a good peer. Build it only if the counters show warming waste is material, and only on top of the peer map — not as its own feature.

    Related: #1758 (egress-aware sourcing) remains the sibling economics question and is unaffected.

  3. moved this from Backlog to In progress in deCDNon Sep 18, 2026
  4. moved this from In progress to Done in deCDNon Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:nodedesign:adrdesign:missing-decisionprio:medium

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions