Skip to content

bundle pull: prefer the manifest's node for chunk fetches, fall back to discovery #1294

Closed

Description

@yigitdot

Follow-up from review on #1293.

PullCtx::reconstruct_entry fetches each chunk of a DECDNMAN file manifest through PullCtx::fetch, which calls pick. With auto-discovery active (no --node-id), that runs a full probe_and_rank round across all candidates per chunk. A 10 GiB file is 40 chunks, so a bundle entry that expands into a manifest costs 40 probe fan-outs before any bytes move.

The obvious fix — pin the manifest blob's (node_id, provider) for all chunks — is not safe on its own: probe_and_rank filters candidates on resp.body.has_blob for the hash being fetched (crates/cli/src/commands/fetch.rs:290), so the per-chunk pick is what guarantees the chosen node actually holds that chunk. Nodes hold blob subsets and evict independently; pinning turns a per-chunk availability check into an assumption, and a manifest whose tail was evicted from the serving node fails mid-reconstruction instead of finding another holder.

Proposed shape:

  • split a fetch_from(hash, node_id, provider) out of PullCtx::fetch, bypassing pick
  • reconstruct_entry tries the manifest's node first for each chunk
  • on a not-found/refusal from that node, fall back to pick(chunk_hash) for that chunk (and carry the newly discovered node forward as the new preferred target)

That removes the probe from the common path — one fan-out instead of N — while keeping the availability guarantee. Worth checking whether the same preferred-node-with-fallback policy should also apply to sibling entries within one bundle, which today re-probe per entry by design (#936).

Activity

  1. added
    kind:feature
    area:cli
    rust
    prio:medium
    on Jul 19, 2026
  2. self-assigned this
    on Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:featureprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions