Skip to content

max_blob_size_mb caps the byte offset a node may serve, not the bytes it stores per blob #2463

Closed

Description

@alpergundogdu

Problem

max_blob_size_bytes is checked against a byte position, not against how many bytes of a blob the node stores. A node with max_blob_size_mb = 16384 cannot serve any byte past 16 GiB of a larger blob, even when it holds only a few GB of that blob.

On testnet (2026-10-14, about 16:10 UTC) this fired DecdnServeNodeFault on sin1 (26 faults/h), ash1 and lon1 (2/h each). The trigger was reads crossing 16 GiB of LibriSpeech train-other-500.tar.gz (30,593,501,606 bytes, blob c7d021ac059a7006c24bcc36f5b2df28ee936fffaed44fe832cbaf546c182815). Sample error:

client stream ended with a node-side fault: coherent range encode failed: upstream pull failed
before supplying outboard node TreeNode(16777135): reached byte 166912, crossing the 149184-byte
size ceiling (BlobTooLarge)

The faulting node held about 7 GB of the blob (bitfield ranges 4305216..5932448, 7469104..11157760, 14938224..16777168, in 1 KiB chunks). The flow:

  1. The node accepts the client range as a partial holder.
  2. It serves the bytes below 16 GiB.
  3. Its pull-through for the uncached bytes past 16 GiB aborts mid-stream with BlobTooLarge.
  4. The serve path counts that as a node-side encode fault, sometimes after the client has paid.

Where

  • crates/client/src/lib.rs open_progressive_pull: max_received_wire = aligned_wire_len(byte_offset, 0, max_blob_size_bytes), plus the resume-offset guard byte_offset >= max_blob_size_bytes.
  • The receive-loop checks on max_received_wire (next_chunk, terminal_after_write_failure).
  • crates/client/src/driver.rs fill_gap (content frontier vs cap).
  • crates/client/src/scheduler.rs acquire (AcquireEnv::max_blob_bytes).
  • The node window path (crates/node/src/handlers/client/window.rs, node_origin max_blob_size_bytes).
  • The partial-holder size handshake in source_set.rs, which assumes the offset meaning.

Expected

The cap limits how many bytes of one blob a node stores. A node serves any range of a large blob, offsets past the cap included, while its stored bytes for that blob stay within the cap. Declining a large blob up front is the wrong fix: requests are ranges, and a node holding part of a blob is useful capacity.

Keep #1895: never refuse on the peer's unverified total_bytes claim. Meter only bytes that arrive and are stored. A pull that would push stored bytes over the cap ends as a clean refusal the client fails over on. It never counts toward decdn_serve_stream_node_fault_total.

Mitigation in place

The fleet's max_blob_size_mb and disk_headroom_mb are raised to 32 GiB (decdn/internal-devops#41). That covers every single file in the demo catalogue and leaves the offset bug in place.

Activity

  1. moved this from Backlog to In progress in deCDNon Oct 14, 2026
  2. moved this from In progress to Done in deCDNon Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions