Skip to content

Commit

Permalink
Merge pull request #63 from intergral/ts_messed_up
Browse files Browse the repository at this point in the history
fix(querier): queries would not select the correct metas
  • Loading branch information
Umaaz authored Oct 5, 2023
2 parents a89f034 + b3ec1f7 commit dba64e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/docker-compose/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/deep-data/
**/tempo-data/
dev*
4 changes: 1 addition & 3 deletions modules/frontend/searchsharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,7 @@ func (s *searchSharder) ingesterRequest(ctx context.Context, tenantID string, pa
subR := parent.Clone(ctx)
subR.Header.Set(user.OrgIDHeaderName, tenantID)

searchReq.Start = ingesterStart
searchReq.End = ingesterEnd
subR, err := api.BuildSearchRequest(subR, searchReq)
subR, err := api.BuildIngesterSearchRequest(subR, searchReq, ingesterStart, ingesterEnd)
if err != nil {
return nil, err
}
Expand Down
17 changes: 17 additions & 0 deletions pkg/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,23 @@ func ParseSearchBlockRequest(r *http.Request) (*deeppb.SearchBlockRequest, error
return req, nil
}

// BuildIngesterSearchRequest takes a deeppb.SearchRequest and creates a request for searching the ingesters
func BuildIngesterSearchRequest(req *http.Request, searchReq *deeppb.SearchRequest, start, end uint32) (*http.Request, error) {
if searchReq == nil {
return req, nil
}

request, err := BuildSearchRequest(req, searchReq)
if err != nil {
return nil, err
}
q := request.URL.Query()
q.Set(urlParamStart, strconv.FormatUint(uint64(start), 10))
q.Set(urlParamEnd, strconv.FormatUint(uint64(end), 10))

return request, nil
}

// BuildSearchRequest takes a deeppb.SearchRequest and populates the passed http.Request
// with the appropriate params. If no http.Request is provided a new one is created.
func BuildSearchRequest(req *http.Request, searchReq *deeppb.SearchRequest) (*http.Request, error) {
Expand Down

0 comments on commit dba64e0

Please sign in to comment.