Skip to content

Commit

Permalink
handle all postings added twice
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <benye@amazon.com>
  • Loading branch information
yeya24 committed Apr 4, 2024
1 parent b51bbdd commit 20033e2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tsdb/querier.go
Expand Up @@ -237,12 +237,7 @@ func PostingsForMatchers(ctx context.Context, ix IndexReader, ms ...*labels.Matc
}
switch {
case m.Name == "" && m.Value == "": // Special-case for AllPostings, used in tests at least.
k, v := index.AllPostingsKey()
allPostings, err := ix.Postings(ctx, k, v)
if err != nil {
return nil, err
}
its = append(its, allPostings)
// Does nothing since AllPostings already added due to hasSubtractingMatchers.
case labelMustBeSet[m.Name]:
// If this matcher must be non-empty, we can be smarter.
matchesEmpty := m.Matches("")
Expand Down

0 comments on commit 20033e2

Please sign in to comment.