Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions app/vtselect/logsql/logsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package logsql
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"math"
Expand All @@ -29,17 +28,14 @@ import (
"github.com/valyala/fastjson"
"github.com/valyala/quicktemplate"

"github.com/VictoriaMetrics/VictoriaTraces/app/vtselect/searchutil"
"github.com/VictoriaMetrics/VictoriaTraces/app/vtstorage"
)

var (
maxQueryTimeRange = flagutil.NewExtendedDuration("search.maxQueryTimeRange", "0", "The maximum time range, which can be set in the query sent to querying APIs. "+
"Queries with bigger time ranges are rejected. See https://docs.victoriametrics.com/victorialogs/querying/#resource-usage-limits")

allowPartialResponseFlag = flag.Bool("search.allowPartialResponse", false, "Whether to allow returning partial responses when some of vtstorage nodes "+
"from the -storageNode list are unavailable for querying. This flag works only for cluster setup of VictoriaLogs. "+
"See https://docs.victoriametrics.com/victorialogs/querying/#partial-responses")

maxQueryLen = flagutil.NewBytes("search.maxQueryLen", 16*1024, "The maximum query length in bytes, which can be passed to /select/* endpoints")
)

Expand Down Expand Up @@ -1581,8 +1577,8 @@ func parseCommonArgsWithConfig(r *http.Request, skipMaxRangeCheck bool) (*common
}
}

allowPartialResponse := *allowPartialResponseFlag
if err := getBoolFromRequest(&allowPartialResponse, r, "allow_partial_response"); err != nil {
allowPartialResponse, err := searchutil.GetAllowPartialResponse(r)
if err != nil {
return nil, err
}

Expand Down
26 changes: 26 additions & 0 deletions app/vtselect/searchutil/partial_response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package searchutil

import (
"flag"
"fmt"
"net/http"
"strconv"
)

var allowPartialResponseFlag = flag.Bool("search.allowPartialResponse", false, "Whether to allow returning partial responses when some of vtstorage nodes "+
"from the -storageNode list are unavailable for querying. This flag works only for cluster setup of VictoriaTraces. "+
"See https://docs.victoriametrics.com/victorialogs/querying/#partial-responses")

// GetAllowPartialResponse returns the effective allow_partial_response value for r.
func GetAllowPartialResponse(r *http.Request) (bool, error) {
allowPartialResponse := *allowPartialResponseFlag
s := r.FormValue("allow_partial_response")
if s == "" {
return allowPartialResponse, nil
}
b, err := strconv.ParseBool(s)
if err != nil {
return false, fmt.Errorf("cannot parse allow_partial_response=%q as bool: %w", s, err)
}
return b, nil
}
11 changes: 9 additions & 2 deletions app/vtselect/traces/tracecommon/tracecommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/VictoriaMetrics/VictoriaLogs/lib/logstorage"

"github.com/VictoriaMetrics/VictoriaTraces/app/vtselect/searchutil"
"github.com/VictoriaMetrics/VictoriaTraces/app/vtstorage"
)

Expand Down Expand Up @@ -75,9 +76,15 @@ func GetCommonParams(r *http.Request) (*CommonParams, error) {
return nil, err
}

allowPartialResponse, err := searchutil.GetAllowPartialResponse(r)
if err != nil {
return nil, err
}

cp := &CommonParams{
TenantIDs: tenantIDs,
HiddenFieldsFilters: hiddenFieldsFilters,
TenantIDs: tenantIDs,
AllowPartialResponse: allowPartialResponse,
HiddenFieldsFilters: hiddenFieldsFilters,
}

return cp, nil
Expand Down
2 changes: 2 additions & 0 deletions docs/victoriatraces/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The following `tip` changes can be tested by building VictoriaTraces components

## tip

* BUGFIX: vtselect in [VictoriaTraces cluster](https://docs.victoriametrics.com/victoriatraces/cluster/): apply `-search.allowPartialResponse` for Tempo and Jaeger query APIs. Previously the flag affected only LogsQL query handlers, so Tempo and Jaeger requests still failed when a queried `vtstorage` node was unavailable. See [#157](https://github.com/VictoriaMetrics/VictoriaTraces/issues/157).

## [v0.9.3](https://github.com/VictoriaMetrics/VictoriaTraces/releases/tag/v0.9.3)

Released at 2026-06-18
Expand Down
3 changes: 2 additions & 1 deletion docs/victoriatraces/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ For advanced setups, refer to the [multi-level cluster setup](#multi-level-clust

In the cluster setup, the following rules apply:

- The `vtselect` component requires **all relevant vtstorage nodes to be available** in order to return complete and correct query results.
- The `vtselect` component requires **all relevant vtstorage nodes to be available** in order to return complete and correct query results by default.

- If even one of the vtstorage nodes is temporarily unavailable, `vtselect` cannot safely return a full response, since some of the required data may reside on the missing node. Rather than risk delivering partial or misleading query results, which can cause confusion, trigger false alerts, or produce incorrect metrics, VictoriaTraces chooses to return an error instead.
- If returning incomplete query results is preferable to returning an error during temporary `vtstorage` outages, you can enable [partial responses](https://docs.victoriametrics.com/victorialogs/querying/#partial-responses). The returned data may miss spans stored on unavailable nodes.

- The `vtinsert` component continues to function normally when some vtstorage nodes are unavailable. It automatically routes new trace spans to the remaining available nodes to ensure that data ingestion remains uninterrupted and newly received spans are not lost.

Expand Down