From 804304c365b72afca08f769e16e02834a218149c Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 4 Sep 2020 02:23:12 +0300 Subject: [PATCH] app/vmselect: add missing deletion for temporary files on partial responses when `-search.denyPartialResponse=true` --- app/vmselect/prometheus/prometheus.go | 2 ++ app/vmselect/promql/eval.go | 1 + 2 files changed, 3 insertions(+) diff --git a/app/vmselect/prometheus/prometheus.go b/app/vmselect/prometheus/prometheus.go index df78fe6596..1305956948 100644 --- a/app/vmselect/prometheus/prometheus.go +++ b/app/vmselect/prometheus/prometheus.go @@ -91,6 +91,7 @@ func FederateHandler(startTime time.Time, at *auth.Token, w http.ResponseWriter, return fmt.Errorf("cannot fetch data for %q: %w", sq, err) } if isPartial && getDenyPartialResponse(r) { + rss.Cancel() return fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") } @@ -669,6 +670,7 @@ func SeriesHandler(startTime time.Time, at *auth.Token, w http.ResponseWriter, r return fmt.Errorf("cannot fetch data for %q: %w", sq, err) } if isPartial && getDenyPartialResponse(r) { + rss.Cancel() return fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") } diff --git a/app/vmselect/promql/eval.go b/app/vmselect/promql/eval.go index 2a49ae3653..d411e785aa 100644 --- a/app/vmselect/promql/eval.go +++ b/app/vmselect/promql/eval.go @@ -670,6 +670,7 @@ func evalRollupFuncWithMetricExpr(ec *EvalConfig, name string, rf rollupFunc, return nil, err } if isPartial && ec.DenyPartialResponse { + rss.Cancel() return nil, fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") } rssLen := rss.Len()