Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always request querier to return gzipped response #4960

Merged
merged 2 commits into from Nov 10, 2022

Conversation

alanprot
Copy link
Member

What this PR does:

Before this change, the query-frontend did not do any manipulation for instant queries and the QF was basically a proxy.

#4863 changed that and introduced middlewares also for instant queries in order to be able to manipulate the queries and implement the shard by optimization.

The problem now is that we are not forwarding all the headers from the original request to the querier, including the Accept-Encoding one and, this means that we stopped to gzip those requests between the query-frontend and the querier.

PS: This was already the case for query_range

This PR is changing this behavior and making the QF always ask the querier to return the response gzipped.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • [NA] Tests updated
  • [NA] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alan Protasio <approtas@amazon.com>
Copy link
Collaborator

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM

@alanprot alanprot merged commit ba6b156 into cortexproject:master Nov 10, 2022
@@ -203,6 +203,9 @@ func (instantQueryCodec) EncodeRequest(ctx context.Context, r tripperware.Reques
}
}

// Always ask gzip to the querier
h.Set("Accept-Encoding", "gzip")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we configure the forwarded headers with Accept-Encoding here https://github.com/cortexproject/cortex/blob/master/pkg/querier/tripperware/roundtrip.go#L120 then is this still necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we configured that before it would break everything.. as the result would be compressed and we were not expecting that! =/

We wanna send always.. not only when the customer send..

t00350320 pushed a commit to t00350320/cortex that referenced this pull request Nov 15, 2022
* Always request querier to return gzipped response

Signed-off-by: Alan Protasio <approtas@amazon.com>

* make lint happy

Signed-off-by: Alan Protasio <approtas@amazon.com>

Signed-off-by: Alan Protasio <approtas@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants