diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fa0b16735..e40362fd54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ Since there are no consistency guarantees provided by some Object Storage provid - [#2090](https://github.com/thanos-io/thanos/issues/2090) *breaking* Downsample command: the `downsample` command has moved as the `thanos bucket` sub-command, and cannot be called via `thanos downsample` any more. - [#2294](https://github.com/thanos-io/thanos/pull/2294) store: optimizations for fetching postings. Queries using `=~".*"` matchers or negation matchers (`!=...` or `!~...`) benefit the most. - [#2301](https://github.com/thanos-io/thanos/pull/2301) Ruler: initlialization fails with filepath bad pattern error and rule manager update error. +- [#2310](https://github.com/thanos-io/thanos/pull/2310) query: Report timespan 0 to 0 when discovering no stores. ## [v0.11.0](https://github.com/thanos-io/thanos/releases/tag/v0.11.0) - 2020.03.02 diff --git a/pkg/store/proxy.go b/pkg/store/proxy.go index 5aeaca3258..8440de2f96 100644 --- a/pkg/store/proxy.go +++ b/pkg/store/proxy.go @@ -109,9 +109,9 @@ func (s *ProxyStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb maxTime := int64(0) stores := s.stores() - // Edge case: we have all of the data if there are no stores. + // Edge case: we have no data if there are no stores. if len(stores) == 0 { - res.MaxTime = math.MaxInt64 + res.MaxTime = 0 res.MinTime = 0 return res, nil diff --git a/pkg/store/proxy_test.go b/pkg/store/proxy_test.go index c90247ee39..1e49cce456 100644 --- a/pkg/store/proxy_test.go +++ b/pkg/store/proxy_test.go @@ -7,7 +7,6 @@ import ( "context" "fmt" "io" - "math" "os" "sort" "testing" @@ -69,7 +68,7 @@ func TestProxyStore_Info(t *testing.T) { testutil.Equals(t, []storepb.LabelSet(nil), resp.LabelSets) testutil.Equals(t, storepb.StoreType_QUERY, resp.StoreType) testutil.Equals(t, int64(0), resp.MinTime) - testutil.Equals(t, int64(math.MaxInt64), resp.MaxTime) + testutil.Equals(t, int64(0), resp.MaxTime) } func TestProxyStore_Series(t *testing.T) {