Skip to content

Commit

Permalink
pkg/store: Report no data if no stores discovered (#2310)
Browse files Browse the repository at this point in the history
* pkg/store: Report no data if no stores discovered

Signed-off-by: Frederic Branczyk <[email protected]>

* CHANGELOG.md: Add timespan reported on empty stores

Signed-off-by: Frederic Branczyk <[email protected]>
  • Loading branch information
brancz authored Mar 25, 2020
1 parent 2262f26 commit c040657
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit c040657

Please sign in to comment.