Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Renamed 'all' to 'allRequested'.
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
  • Loading branch information
pstibrany committed Mar 19, 2020
commit f3e16562d6a3e484a70af3166f944dabc0919ad6
6 changes: 3 additions & 3 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ func newBucketIndexReader(ctx context.Context, block *bucketBlock) *bucketIndexR
func (r *bucketIndexReader) ExpandedPostings(ms []*labels.Matcher) ([]uint64, error) {
var postingGroups []*postingGroup

all := false
allRequested := false
hasAdds := false
keys := []labels.Label(nil)

Expand All @@ -1330,7 +1330,7 @@ func (r *bucketIndexReader) ExpandedPostings(ms []*labels.Matcher) ([]uint64, er
}

postingGroups = append(postingGroups, pg)
all = all || pg.addAll
allRequested = allRequested || pg.addAll
hasAdds = hasAdds || len(pg.addKeys) > 0

// postings returned by fetchPostings will be in the same order as keys
Expand All @@ -1346,7 +1346,7 @@ func (r *bucketIndexReader) ExpandedPostings(ms []*labels.Matcher) ([]uint64, er

allKeyIndex := -1
// we only need All postings if there are no other adds. If there are, we can skip fetching ALL postings completely.
if all && !hasAdds {
if allRequested && !hasAdds {
// remember the index (will be used later as a flag, and also to access postings),
// and ask fetchPostings to fetch ALL postings too
allKeyIndex = len(keys)
Expand Down