Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/store: Report no data if no stores discovered #2310

Merged
merged 2 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pkg/store/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions pkg/store/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"fmt"
"io"
"math"
"os"
"sort"
"testing"
Expand Down Expand Up @@ -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) {
Expand Down