Skip to content

Commit

Permalink
all: get rid of query pushdown to simplify query path
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
  • Loading branch information
MichaHoffmann committed Jan 22, 2024
1 parent ae93ed6 commit 0bf5c39
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 926 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Removed

- [#7014](https://github.com/thanos-io/thanos/pull/7014) *: *breaking :warning:* Removed experimental query pushdown feature to simplify query path. This feature has had high complexity for too little benefits.

## [v0.33.0](https://github.com/thanos-io/thanos/tree/release-0.33) - 18.12.2023

### Fixed
Expand Down
12 changes: 4 additions & 8 deletions cmd/thanos/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func registerQuery(app *extkingpin.App) {

activeQueryDir := cmd.Flag("query.active-query-path", "Directory to log currently active queries in the queries.active file.").Default("").String()

featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is "+queryPushdown+".").Default("").Strings()
featureList := cmd.Flag("enable-feature", "Comma separated experimental feature names to enable.The current list of features is empty.").Hidden().Default("").Strings()

enableExemplarPartialResponse := cmd.Flag("exemplar.partial-response", "Enable partial response for exemplar endpoint. --no-exemplar.partial-response for disabling.").
Hidden().Default("true").Bool()
Expand Down Expand Up @@ -232,17 +232,16 @@ func registerQuery(app *extkingpin.App) {
return errors.Wrap(err, "parse federation labels")
}

var enableQueryPushdown bool
for _, feature := range *featureList {
if feature == queryPushdown {
enableQueryPushdown = true
}
if feature == promqlAtModifier {
level.Warn(logger).Log("msg", "This option for --enable-feature is now permanently enabled and therefore a no-op.", "option", promqlAtModifier)
}
if feature == promqlNegativeOffset {
level.Warn(logger).Log("msg", "This option for --enable-feature is now permanently enabled and therefore a no-op.", "option", promqlNegativeOffset)
}
if feature == queryPushdown {
level.Warn(logger).Log("msg", "This option for --enable-feature is now permanently deprecated and therefore ignored.", "option", queryPushdown)
}
}

httpLogOpts, err := logging.ParseHTTPOptions(reqLogConfig)
Expand Down Expand Up @@ -335,7 +334,6 @@ func registerQuery(app *extkingpin.App) {
*strictEndpoints,
*strictEndpointGroups,
*webDisableCORS,
enableQueryPushdown,
*alertQueryURL,
*grpcProxyStrategy,
component.Query,
Expand Down Expand Up @@ -417,7 +415,6 @@ func runQuery(
strictEndpoints []string,
strictEndpointGroups []string,
disableCORS bool,
enableQueryPushdown bool,
alertQueryURL string,
grpcProxyStrategy string,
comp component.Component,
Expand Down Expand Up @@ -708,7 +705,6 @@ func runQuery(
enableTargetPartialResponse,
enableMetricMetadataPartialResponse,
enableExemplarPartialResponse,
enableQueryPushdown,
queryReplicaLabels,
flagsMap,
defaultRangeQueryStep,
Expand Down
3 changes: 0 additions & 3 deletions docs/components/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ Flags:
--alert.query-url=ALERT.QUERY-URL
The external Thanos Query URL that would be set
in all alerts 'Source' field.
--enable-feature= ... Comma separated experimental feature names
to enable.The current list of features is
query-pushdown.
--endpoint=<endpoint> ... Addresses of statically configured Thanos
API servers (repeatable). The scheme may be
prefixed with 'dns+' or 'dnssrv+' to detect
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/query/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func (g *GRPCAPI) Query(request *querypb.QueryRequest, server querypb.Query_Quer
storeMatchers,
maxResolution,
request.EnablePartialResponse,
request.EnableQueryPushdown,
false,
request.ShardInfo,
query.NoopSeriesStatsReporter,
Expand Down Expand Up @@ -195,7 +194,6 @@ func (g *GRPCAPI) QueryRange(request *querypb.QueryRangeRequest, srv querypb.Que
storeMatchers,
maxResolution,
request.EnablePartialResponse,
request.EnableQueryPushdown,
false,
request.ShardInfo,
query.NoopSeriesStatsReporter,
Expand Down
58 changes: 30 additions & 28 deletions pkg/api/query/querypb/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/api/query/querypb/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ message QueryRequest {

bool enableDedup = 7;
bool enablePartialResponse = 8;
// Deprecated
bool enableQueryPushdown = 9;
bool skipChunks = 10;

Expand Down Expand Up @@ -80,6 +81,7 @@ message QueryRangeRequest {

bool enableDedup = 9;
bool enablePartialResponse = 10;
// Deprecated
bool enableQueryPushdown = 11;
bool skipChunks = 12;

Expand Down
10 changes: 0 additions & 10 deletions pkg/api/query/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ type QueryAPI struct {
enableTargetPartialResponse bool
enableMetricMetadataPartialResponse bool
enableExemplarPartialResponse bool
enableQueryPushdown bool
disableCORS bool

replicaLabels []string
Expand Down Expand Up @@ -196,7 +195,6 @@ func NewQueryAPI(
enableTargetPartialResponse bool,
enableMetricMetadataPartialResponse bool,
enableExemplarPartialResponse bool,
enableQueryPushdown bool,
replicaLabels []string,
flagsMap map[string]string,
defaultRangeQueryStep time.Duration,
Expand Down Expand Up @@ -233,7 +231,6 @@ func NewQueryAPI(
enableTargetPartialResponse: enableTargetPartialResponse,
enableMetricMetadataPartialResponse: enableMetricMetadataPartialResponse,
enableExemplarPartialResponse: enableExemplarPartialResponse,
enableQueryPushdown: enableQueryPushdown,
replicaLabels: replicaLabels,
endpointStatus: endpointStatus,
defaultRangeQueryStep: defaultRangeQueryStep,
Expand Down Expand Up @@ -565,7 +562,6 @@ func (qapi *QueryAPI) queryExplain(r *http.Request) (interface{}, []error, *api.
storeDebugMatchers,
maxSourceResolution,
enablePartialResponse,
qapi.enableQueryPushdown,
false,
shardInfo,
query.NewAggregateStatsReporter(&seriesStats),
Expand Down Expand Up @@ -668,7 +664,6 @@ func (qapi *QueryAPI) query(r *http.Request) (interface{}, []error, *api.ApiErro
storeDebugMatchers,
maxSourceResolution,
enablePartialResponse,
qapi.enableQueryPushdown,
false,
shardInfo,
query.NewAggregateStatsReporter(&seriesStats),
Expand Down Expand Up @@ -835,7 +830,6 @@ func (qapi *QueryAPI) queryRangeExplain(r *http.Request) (interface{}, []error,
storeDebugMatchers,
maxSourceResolution,
enablePartialResponse,
qapi.enableQueryPushdown,
false,
shardInfo,
query.NewAggregateStatsReporter(&seriesStats),
Expand Down Expand Up @@ -968,7 +962,6 @@ func (qapi *QueryAPI) queryRange(r *http.Request) (interface{}, []error, *api.Ap
storeDebugMatchers,
maxSourceResolution,
enablePartialResponse,
qapi.enableQueryPushdown,
false,
shardInfo,
query.NewAggregateStatsReporter(&seriesStats),
Expand Down Expand Up @@ -1062,7 +1055,6 @@ func (qapi *QueryAPI) labelValues(r *http.Request) (interface{}, []error, *api.A
storeDebugMatchers,
0,
enablePartialResponse,
qapi.enableQueryPushdown,
true,
nil,
query.NoopSeriesStatsReporter,
Expand Down Expand Up @@ -1155,7 +1147,6 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr
storeDebugMatchers,
math.MaxInt64,
enablePartialResponse,
qapi.enableQueryPushdown,
true,
nil,
query.NoopSeriesStatsReporter,
Expand Down Expand Up @@ -1212,7 +1203,6 @@ func (qapi *QueryAPI) labelNames(r *http.Request) (interface{}, []error, *api.Ap
storeDebugMatchers,
0,
enablePartialResponse,
qapi.enableQueryPushdown,
true,
nil,
query.NoopSeriesStatsReporter,
Expand Down
Loading

0 comments on commit 0bf5c39

Please sign in to comment.