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
Typo
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
  • Loading branch information
pstibrany committed Mar 19, 2020
commit ae3f5af32d5aa99c8309187f7c5ae1f233925c7f
2 changes: 1 addition & 1 deletion pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ func (r *bucketIndexReader) ExpandedPostings(ms []*labels.Matcher) ([]uint64, er
return nil, errors.Wrap(err, "toPostingGroup")
}

// interesction would return no postings anyway
// intersection would return no postings anyway
if pg.alwaysEmptyPostings() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if pg.alwaysEmptyPostings() {
if pg.IsEmptyPostings() {

Copy link
Contributor Author

@pstibrany pstibrany Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsEmptyPostings is a different guarantee... there can be labels that are not present in the block, and will also return empty postings. IsEmptyPostings name would suggest that it returns true in such case, but it doesn't. On the other hand, IsAlwaysEmptyPostings (new suggested name) says that this will be empty no matter the block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this method in favor of checking for specific emptyPostingsGroup sentinel value.

Copy link
Contributor Author

@pstibrany pstibrany Mar 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now removed check for sentinel value again, since it's incorrect. We really need to check if group is empty. There are other ways how group can be empty, e.g. by using label="non-existant-value" matcher.

return nil, nil
}
Expand Down