app/vmselect: add missing deletion for temporary files on partial responses when -search.denyPartialResponse=true

This commit is contained in:
Aliaksandr Valialkin 2020-09-04 02:23:12 +03:00
parent d2f6f96e4a
commit 804304c365
2 changed files with 3 additions and 0 deletions

View file

@ -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) return fmt.Errorf("cannot fetch data for %q: %w", sq, err)
} }
if isPartial && getDenyPartialResponse(r) { if isPartial && getDenyPartialResponse(r) {
rss.Cancel()
return fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") 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) return fmt.Errorf("cannot fetch data for %q: %w", sq, err)
} }
if isPartial && getDenyPartialResponse(r) { if isPartial && getDenyPartialResponse(r) {
rss.Cancel()
return fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") return fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable")
} }

View file

@ -670,6 +670,7 @@ func evalRollupFuncWithMetricExpr(ec *EvalConfig, name string, rf rollupFunc,
return nil, err return nil, err
} }
if isPartial && ec.DenyPartialResponse { if isPartial && ec.DenyPartialResponse {
rss.Cancel()
return nil, fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable") return nil, fmt.Errorf("cannot return full response, since some of vmstorage nodes are unavailable")
} }
rssLen := rss.Len() rssLen := rss.Len()