From 21a42e990f28f3b0eff84442ced6cafea5336a2a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 12 Feb 2022 00:27:08 +0200 Subject: [PATCH] lib/storage: fix broken BenchmarkHeadPostingForMatchers for `{i=~".*"}` after f4dead529f5e10a5ed2c12cadf4d5d23bc28bed4 The commit f4dead529f5e10a5ed2c12cadf4d5d23bc28bed4 makes such query to return nothing instead of all the time series. This aligns more with Prometheus behaviour. --- lib/storage/index_db_timing_test.go | 2 +- lib/storage/tag_filters.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/storage/index_db_timing_test.go b/lib/storage/index_db_timing_test.go index ed090553f1..e2c84135dd 100644 --- a/lib/storage/index_db_timing_test.go +++ b/lib/storage/index_db_timing_test.go @@ -206,7 +206,7 @@ func BenchmarkHeadPostingForMatchers(b *testing.B) { b.Run(`i=~".*"`, func(b *testing.B) { tfs := NewTagFilters(accountID, projectID) addTagFilter(tfs, "i", ".*", false, true) - benchSearch(b, tfs, 5e6) + benchSearch(b, tfs, 0) }) b.Run(`i=~".+"`, func(b *testing.B) { tfs := NewTagFilters(accountID, projectID) diff --git a/lib/storage/tag_filters.go b/lib/storage/tag_filters.go index 60345a5845..8428dc5220 100644 --- a/lib/storage/tag_filters.go +++ b/lib/storage/tag_filters.go @@ -168,7 +168,7 @@ func (tfs *TagFilters) Add(key, value []byte, isNegative, isRegexp bool) error { } if isRegexp && string(value) == ".*" { if !isNegative { - // Skip tag filter matching anything, since it equal to no filter. + // Skip tag filter matching anything, since it equals to no filter. return nil }