From e911f03a628931a2936af31f038d81c59b606d65 Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Wed, 14 Dec 2022 16:12:14 +0100 Subject: [PATCH] Fix mint and maxt for api/v1/series call (#5966) * Fix mint and maxt for api/v1/series call The storage querier currently uses select hints to set the start and end time of the series select rpc. The same rpc is also used for the api/v1/series API which does not produce any hints. This commit changes the querier to use the mint and maxt from the query itself when selecting series from stores. Signed-off-by: Filip Petkovski * Add CHANGELOG entry Signed-off-by: Filip Petkovski Signed-off-by: Filip Petkovski --- CHANGELOG.md | 3 ++- pkg/query/querier.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65051ae945..7f4e067436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5854](https://github.com/thanos-io/thanos/pull/5854) Query Frontend: Handles `lookback_delta` param in query frontend. - [#5230](https://github.com/thanos-io/thanos/pull/5230) Rule: Stateless ruler support restoring `for` state from query API servers. The query API servers should be able to access the remote write storage. - [#5880](https://github.com/thanos-io/thanos/pull/5880) Query Frontend: Fixes some edge cases of query sharding analysis. -- [#5893](https://github.com/thanos-io/thanos/pull/5893) Cache: fixed redis client not respecting `SetMultiBatchSize` config value. +- [#5893](https://github.com/thanos-io/thanos/pull/5893) Cache: Fixed redis client not respecting `SetMultiBatchSize` config value. +- [#5966](https://github.com/thanos-io/thanos/pull/5966) Query: Fixed mint and maxt when selecting series for the `api/v1/series` HTTP endpoint. ### Added diff --git a/pkg/query/querier.go b/pkg/query/querier.go index b094cbd45c..9fe4b96eca 100644 --- a/pkg/query/querier.go +++ b/pkg/query/querier.go @@ -349,8 +349,8 @@ func (q *querier) selectFn(ctx context.Context, hints *storage.SelectHints, ms . } if err := q.proxy.Series(&storepb.SeriesRequest{ - MinTime: hints.Start, - MaxTime: hints.End, + MinTime: q.mint, + MaxTime: q.maxt, Matchers: sms, MaxResolutionWindow: q.maxResolutionMillis, Aggregates: aggrs,