Skip to content

Commit

Permalink
Disable scalar for vertical sharding
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Jung <jungjust@amazon.com>
  • Loading branch information
justinjung04 committed Mar 14, 2023
1 parent c88f5a3 commit ead360e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
### Changed
- [#6168](https://github.com/thanos-io/thanos/pull/6168) Receiver: Make ketama hashring fail early when configured with number of nodes lower than the replication factor.
- [#6201](https://github.com/thanos-io/thanos/pull/6201) Query-Frontend: Disable absent and absent_over_time for vertical sharding.
- [#6212](https://github.com/thanos-io/thanos/pull/6212) Query-Frontend: Disable scalar for vertical sharding.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion pkg/querysharding/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (a *QueryAnalyzer) Analyze(query string) (QueryAnalysis, error) {
if n.Func.Name == "label_join" || n.Func.Name == "label_replace" {
dstLabel := stringFromArg(n.Args[1])
dynamicLabels = append(dynamicLabels, dstLabel)
} else if n.Func.Name == "absent_over_time" || n.Func.Name == "absent" {
} else if n.Func.Name == "absent_over_time" || n.Func.Name == "absent" || n.Func.Name == "scalar" {
isShardable = false
return notShardableErr
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/querysharding/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ http_requests_total`,
name: "absent is not shardable",
expression: `sum by (url) (absent(http_requests_total{code="400"}))`,
},
{
name: "scalar is not shardable",
expression: `scalar(sum by (url) (http_requests_total{code="400"}))`,
},
}

shardableByLabels := []testCase{
Expand Down

0 comments on commit ead360e

Please sign in to comment.