Skip to content

feat(node): port resume::pull_blob onto BlobSource/NodeAdmitStore — the last O(blob) ingest path #1682

Closed

Description

@yigitdot

Problem

node_origin::resume::pull_blob accumulates the whole blob into LoopState.buf: Vec<u8> and hands it back as OriginFetch::found_one_shot(bytes). It is the last ingest path holding a whole blob in RAM — every other miss source streams to disk at O(chunk-group) through admit_bao_stream (#1607) and the BlobSource unification (#1608).

That asymmetry has a direct cost. #1678 removed max_blob_size_mb and made cache.cache_size_mb the only ceiling, because with memory off the table a node should serve any blob its disk holds. This tier could not follow: a 10 GiB disk budget is not 10 GiB of RSS to spend on one pull. So it kept a ceiling in its own quantity — cache.origin_retry.buffered_max_bytes, 4 MiB by default.

Consequence today: the buffered node-to-node fallback tier refuses blobs over 4 MiB, and they must arrive through the streaming window tier instead.

Intent

Drive this loop through BlobSource + NodeAdmitStore like the gap-driven driver does, so the buffer disappears and with it the ceiling. Then delete BufferedTierTooLarge and NodeOriginConfig.buffered_tier_max_bytes, and drop PullVerdict::OversizeClaim and decdn_node_pull_too_large_total with them.

What makes it non-trivial

The loop is not just a sink swap — resume.rs's module doc lists why it was not pushed into client-pull in the first place, and each reason is work here:

  • Resumable rewind. The retry path rewinds with Vec::truncate back to the paid frontier (content_paid_frontier). Against a ranged store the equivalent is re-deriving missing ranges, not truncating.
  • Reactive mid-pull top-up (Node reactive mid-pull top-up (node-to-node buyer leg) #1530): MAX_REACTIVE_TOPUPS, the settle wait, fund(). The gap-driven driver has its own funder seam (DriveConfig, Funder::max_topups) — reconcile rather than duplicate.
  • Reputation + settle bookkeeping. pull_from_candidate scores the provider and holds SettleOnDrop; the verdict ladder (pull_verdict) must keep classifying correctly.
  • Origin::fetch owes its caller one contiguous Bytes. The cache engine's Origin trait shape is what forces the buffer. Either that call site reads back from the store after admission, or NodeOrigin stops implementing Origin for this path.

Payoff

History

Split out of #1678. #1608's BlobSource unification covered BackendSource and PeerSource; this loop predates it and was left on the old shape.

Activity

  1. added
    kind:feature
    rust
    prio:medium
    on Aug 14, 2026
  2. added a commit that references this issue on Aug 14, 2026
  3. alpergundogdu commented on Aug 14, 2026

    @alpergundogdu
    Contributor

    Staying open. #1685/#1686 default max_blob_size_mb to cache_size_mb but do not touch this loop: resume::pull_blob still buffers the whole blob into LoopState.buf bounded by max_blob_size_bytes. So the new default raises this tier's worst-case RAM to the full disk budget — this port is now the load-bearing fix for that exposure, not just a tidy-up.

  4. added this to the v0.1 milestone on Aug 14, 2026
  5. moved this from Backlog to Done in deCDNon Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featureprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions