Skip to content

fix(render): reject failed required series fetches - #593

Merged
timtofan merged 1 commit into
masterfrom
atimofieiev/fe-partial-gh
Nov 13, 2026
Merged

timtofan merged 1 commit into
masterfrom
atimofieiev/fe-partial-gh

Conversation

@timtofan

Copy link
Copy Markdown
Collaborator

Why

A render can silently lose a required input when its fetch fails but another leaf succeeds. For example, KO/(KO+OK) evaluates to a fake ratio of 1.0 when OK times out and only KO remains. The incomplete result is returned as HTTP 200 and can be cached. Required fetch failures should produce an execution error before expression evaluation.

Architecture

The zipper merges selected backend replicas, then the render handler gathers leaf requests and evaluates the expression. Replica fan-in still succeeds when another selected replica supplies the series. Empty successful replies cannot recover a failed fetch. An all-failed set is NotFound only when every error is NotFound; transport failures must not be masked by a majority of 404s.

Leaf/subrequest fan-in now propagates every non-NotFound failure. Genuine missing series remain available to functions such as fallbackSeries and sumSeries. Known partial results are excluded from the response cache, including successful computations that tolerate missing inputs. Individual and grouped fetches share the same replica recovery rule. No configuration or compatibility path is added.

This change does not add rediscovery, detect HTTP 200 replies containing all-null data, or establish wildcard completeness when a lower layer has already discarded an error.

Before / after

Before After
OK fails, KO succeeds: HTTP 200 and fake ratio 1.0 HTTP 500 execution error before evaluating the expression
A majority of 404s can hide a transport error when every replica fails Any non-404 error in the all-failed set remains an error
An empty successful replica reply hides another replica's failure The fetch fails unless a selected replica supplies the series
Known partial bodies enter the response cache Partial bodies are never published to the response cache
A healthy replica supplies data; an optional series is genuinely missing Replica recovery and missing-series function behavior are preserved

Validation

  • New regressions fail against unchanged code, reproducing ratio 1.0, incorrect full burn-rate results and partial-cache publication.
  • Go 1.27.0: go test -mod=vendor -race -tags cairo,nativegzip ./pkg/app/carbonapi -count=1 passes on this public base.
  • Coverage includes two full burn-rate formula families with both long/short windows, mixed timeout/404 errors, empty successful replies, healthy replica recovery, optional series, fallback functions and cache publication.
  • Repository-configured golangci-lint v2.13.2 reports zero issues; no vendor files changed.

@timtofan
timtofan merged commit 81f215a into master Nov 13, 2026
6 checks passed
@timtofan
timtofan deleted the atimofieiev/fe-partial-gh branch November 13, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants