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 27, 2024
1 parent daa34a5 commit f29b338
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 1,016 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,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. The responsibility for query pushdown will be moved to the distributed mode of the new 'thanos' promql engine.

## [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
163 changes: 47 additions & 116 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.

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

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

ShardInfo shard_info = 11;

int64 lookback_delta_seconds = 12;
EngineType engine = 13;

reserved 9;
}

message StoreMatchers {
Expand Down Expand Up @@ -80,12 +81,13 @@ message QueryRangeRequest {

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

ShardInfo shard_info = 13;
int64 lookback_delta_seconds = 14;
EngineType engine = 15;

reserved 11;
}

message QueryRangeResponse {
Expand Down
Loading

0 comments on commit f29b338

Please sign in to comment.