Skip to content

Ranged-fill cache content is never announced to the DHT; partial holders publish zero provider records #2186

Closed

Description

@thiras

Component

node (decdn-node daemon)

Version

06955a38 (testnet, 2026-09-27)

Operating system

Ubuntu, testnet fleet (7 nodes)

Summary

A node that fills its cache only through ranged serve-miss pulls never publishes a DHT provider record for what it holds. Partial blobs are never announced, and a blob completed through ranged fills is announced only after the next restart. This does not match ADR 022 §STORE Flow (adr/022-content-discovery.md:149): "When a node verifies its first 64 MiB block of blob H — on any verified partial, not only on Complete". It also does not meet ADR 022 AC 21 and AC 25 (range-keyed partial-holder discovery).

Steps to reproduce

  1. Run a non-origin node that gets content only through serve-miss ranged pulls, for example a client bundle pull routed through it.
  2. Watch decdn_dht_store_published_total and the republish scheduler's cold-start log line on restart.

Expected behavior

The node publishes a provider record for H once it verifies its first 64 MiB block, and republishes H on the 30–50 min cycle.

Actual behavior

decdn_dht_store_published_total over the 24 h before 2026-09-27 21:55 UTC:

Node Published Cache fill
fra1 ≈224k 87%
bcl (origin) ≈29k 26%
lon1 ≈5.2k 84%
nbg1 ≈3.2k 37%
ash1 0 19%
hel1 0 10%
hil1 0 0.5%

The three zeros hold for the whole 26 h window. ash1 was serving mistral bundle ranges from its own cache during the check, with decdn_bytes_received_total rate 0.

  • On every restart (09-26 20:32, 09-27 04:18, 10:03, 21:57), hel1's republish cold-start seed logged cold_start_count: 0 while 3.2 GB sat in its cache. fra1 logged 1038–1056.
  • hel1 and fra1 have identical node.toml apart from region, so no config setting explains the difference.
  • Every dht_store_rejected_{non_staked,quota,holder_mismatch} counter is 0. The zero comes from nothing being sent, not from peers refusing.

fra1's volume matches what it holds and is not over-publishing. dht_routing_table_size is 6, which caps the K+3 fanout at 6. So 1038 hashes × 6 receivers / ~2400 s ≈ 2.6/s, which is what we observe.

Root cause

The scheduler in crates/node/src/dht/publish.rs learns a hash from three sources. None of them fires for a ranged fill:

  1. Eager publish on CacheEngine::subscribe_inserts. The only senders are the whole-blob pull_through commits at crates/cache/src/engine.rs:5000 and :5006. The ranged serve-miss pull leg (ADR 037/038/039, handlers/client/serve_leg.rs) never sends an insert event.
  2. Cold-start seed via holder_snapshot (publish.rs:511). It uses iter_hashes, which keeps only BlobStatus::Complete blobs (engine.rs:4271), plus origin-held hashes. A range-filled blob is rarely Complete.
  3. Lag sweep. It runs only when the insert channel reports Lagged. dht_republish_lag_sweeps_total is 0 on every node.

The downstream checks already handle partials: cache_still_holds (publish.rs:1068) and fetch_coverage accept partial coverage. Partials just never enter the scheduler.

Impact

  • Blocks cached on ash1, hel1 and hil1 never appear in FIND_VALUE provider lists. Other nodes' misses skip them and fall back to fra1, lon1, bcl or the origin. This defeats partial-holder supply.
  • On every node, a blob that becomes Complete through ranged fills stays unannounced until the next restart re-seeds it. fra1's holdings are visible only because it restarts often.

Fix

  • Send a cache event when the first 64 MiB discovery block of a hash is verified on any fill path. This can be the existing insert channel or a new one.
  • Make holder_snapshot include partial blobs with non-empty coverage, so the cold-start seed and the lag sweep cover them.
  • Related limitation (publish.rs:1063-1066): a non-origin front partial whose size is unknown gets empty coverage, so cache_still_holds returns Some(false) and the hash stays unannounced even after the two changes above. Handle it in the same fix.

Activity

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

Metadata

Metadata

Assignees

Labels

area:nodekind:bugprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions