app/vmselect: unconditionally deny partial responses from /api/v1/export*

It is expected that `/api/v1/export*` returns full data, so there is no sense in partial responses there.
This commit is contained in:
Aliaksandr Valialkin 2021-01-27 14:38:26 +02:00
parent ff526492eb
commit 5328a102e0

View File

@ -387,14 +387,11 @@ func exportHandler(at *auth.Token, w http.ResponseWriter, r *http.Request, match
resultsCh := make(chan *quicktemplate.ByteBuffer, cgroup.AvailableCPUs()) resultsCh := make(chan *quicktemplate.ByteBuffer, cgroup.AvailableCPUs())
doneCh := make(chan error) doneCh := make(chan error)
if !reduceMemUsage { if !reduceMemUsage {
denyPartialResponse := searchutils.GetDenyPartialResponse(r) denyPartialResponse := true
rss, isPartial, err := netstorage.ProcessSearchQuery(at, denyPartialResponse, sq, true, deadline) rss, _, err := netstorage.ProcessSearchQuery(at, denyPartialResponse, sq, true, deadline)
if err != nil { if err != nil {
return fmt.Errorf("cannot fetch data for %q: %w", sq, err) return fmt.Errorf("cannot fetch data for %q: %w", sq, err)
} }
if isPartial {
return fmt.Errorf("cannot export data, because some of vmstorage nodes are unhealthy")
}
go func() { go func() {
err := rss.RunParallel(func(rs *netstorage.Result, workerID uint) error { err := rss.RunParallel(func(rs *netstorage.Result, workerID uint) error {
if err := bw.Error(); err != nil { if err := bw.Error(); err != nil {