From 8e8bcf8dead9c6744ba6372a515fe346e67379c2 Mon Sep 17 00:00:00 2001 From: Martin Disibio Date: Thu, 13 Oct 2022 16:20:08 -0400 Subject: [PATCH 1/2] Fix issue where presence of http.status_code tag may cause other criteria to be skipped --- tempodb/encoding/vparquet/block_search.go | 2 +- tempodb/encoding/vparquet/block_search_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tempodb/encoding/vparquet/block_search.go b/tempodb/encoding/vparquet/block_search.go index baedae9a1be..653737d5216 100644 --- a/tempodb/encoding/vparquet/block_search.go +++ b/tempodb/encoding/vparquet/block_search.go @@ -276,7 +276,7 @@ func makePipelineWithRowGroups(ctx context.Context, req *tempopb.SearchRequest, if k == LabelHTTPStatusCode { if i, err := strconv.Atoi(v); err == nil { resourceIters = append(resourceIters, makeIter(column, pq.NewIntBetweenPredicate(int64(i), int64(i)), "")) - break + continue } // Non-numeric string field otherAttrConditions[k] = v diff --git a/tempodb/encoding/vparquet/block_search_test.go b/tempodb/encoding/vparquet/block_search_test.go index 508a74816b1..4bd28848de2 100644 --- a/tempodb/encoding/vparquet/block_search_test.go +++ b/tempodb/encoding/vparquet/block_search_test.go @@ -211,6 +211,14 @@ func TestBackendBlockSearch(t *testing.T) { // Span attributes makeReq("foo", "baz"), + + // Multiple + { + Tags: map[string]string{ + "http.status_code": "500", + "service.name": "asdf", + }, + }, } for _, req := range searchesThatDontMatch { res, err := b.Search(ctx, req, defaultSearchOptions()) From d925bb4a758e9adb1a2850f9881bd26687e4daea Mon Sep 17 00:00:00 2001 From: Martin Disibio Date: Thu, 13 Oct 2022 16:23:45 -0400 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6859fe15276..d93ddba90ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Internal types are updated to use `scope` instead of `instrumentation_library`. * [BUGFIX] Honor caching and buffering settings when finding traces by id [#1697](https://github.com/grafana/tempo/pull/1697) (@joe-elliott) * [BUGFIX] Correctly propagate errors from the iterator layer up through the queriers [#1723](https://github.com/grafana/tempo/pull/1723) (@joe-elliott) * [BUGFIX] Make multitenancy work with HTTP [#1781](https://github.com/grafana/tempo/pull/1781) (@gouthamve) +* [BUGFIX] Fix parquet search bug fix on http.status_code that may cause incorrect results to be returned [#1799](https://github.com/grafana/tempo/pull/1799) (@mdisibio) ## v1.5.0 / 2022-08-17