Both of FetchScheduler‘s budgets’ occupancy: count (one permit per
in-flight run, bounding origin-GET parallelism) and bytes (one permit
per in-flight byte, bounding transient fetch memory).
Which caller is invoking RangeCache::stream_ranges, selecting which of
the two distinct range_cache_get_range_error / range_cache_get_ranges_error
counters is emitted on an upfront validation failure or a mid-stream fetch
error. stream_ranges is the single fill path behind both get_range/
get_range_handler (Range) and get_ranges/post_ranges_handler
(Ranges), so the tag keeps the two metric names emitting exactly as they
did before those call sites shared one implementation.
Default fetch-budget cap on transient origin-GET buffer memory (256 MiB):
the smallest budget at which DEFAULT_TOTAL_FETCH_PERMITS runs of
DEFAULT_MAX_COALESCED_GET_BYTES each can all be in flight, so at the
defaults a cold contiguous scan is throttled by parallelism, not memory.
Number of blocks per streamed fetch window used by stream_ranges. At the
default 1 MiB block size, 8 blocks (8 MiB) matches one coalesced origin
GET run (DEFAULT_MAX_COALESCED_GET_BYTES), with buffered(2) giving
modest pipeline overlap. This bounds peak in-flight memory per stream to
roughly 2 * DEMAND_WINDOW_BLOCKS * block_size, independent of how large
the requested range is.
Upper bound on a plausible cached object size. No micromegas lake object
(parquet partition or blob) approaches this; a decoded size above it means a
corrupt/misdecoded cache entry, which is treated as a miss and re-resolved
from origin rather than driving a catastrophic allocation.