Skip to content

client-pull does not distinguish NotFound from InternalError, so the serve path's reason codes are inert #1144

Closed

Description

@thiras

Spun out of the review of #1142.

Problem

#1129 made the serve path report InternalError ("do not retry this node") rather than NotFound ("node lacks the blob") when a node is degraded by an origin/store fault. That distinction is currently inert on the requester side: nothing consumes it.

  • crates/client-pull/src/lib.rs bails identically on every refusal, in both the buffered and progressive paths:
    if !resp.body.ok {
        anyhow::bail!("delivery refused: {:?}", resp.error);
    }
    The StreamError variant is formatted into a string and discarded — no typed sentinel, no branch.
  • NodeOrigin::classify_pull_failure therefore cannot see it either: any refusal that is not one of the typed sentinels (BlobTooLargeClaim, PullTimeout, UpstreamVoucherRejected, HashMismatch) falls through to Outcome::Unreachable → local EWMA hit + gossiped observation.

Two consequences:

  1. A node that honestly reports a clean NotFound is tarred exactly as hard as one reporting InternalError. An upstream that simply does not hold a blob takes an Unreachable reputation hit for saying so. That is wrong on its own terms, independent of Reactive pull-through: a hard origin/store fault terminates as a signed CacheMiss (NotFound), not InternalError — both tiers #1129.
  2. The InternalError signal Reactive pull-through: a hard origin/store fault terminates as a signed CacheMiss (NotFound), not InternalError — both tiers #1129 adds cannot yet change requester behavior (skip the degraded node, prefer another candidate, retry later).

Note this also means a pre-existing comment on ServeRejectReason::wire_error is inaccurate — it claims NotFound is kept "reputation-benign" because "the requester folds a node fault into the node's score". The requester does no such discrimination today. That comment should be corrected or made true.

Suggested work

  • Introduce a typed sentinel for a refusal carrying its StreamError (mirroring BlobTooLargeClaim), so classify_pull_failure can downcast_ref it.
  • Exonerate a wire NotFound refusal (a reachable, honest, empty provider is not Unreachable) — it should at most be a negative-availability signal, not a reputation hit.
  • Let InternalError deprioritise/skip the candidate.
  • Correct the wire_error doc.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions