Skip to content

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Sep 18, 2025

What this PR does:

In #6390, an enhancement of logging request query from body is introduced in Query Frontend. It will try to use pre-parsed request body buffer to get query string and set it back to request body to make sure query works.

However, we don't parse request body to a buffer for remtoe read request because request read body is protobuf compressed. So the change above will go wrong by setting the request body to empty, causing snappy decompression to fail in remote read handler.

The fix made in this PR is simply skip logging query from request body if remote read request because remote read request itself is snappy compressed + protobuf, which can be expensive to decompress and read in order to get the request string itself.

Additional unit test is added as well as improving query frontend integration test to always enable query stats to capture such regression earlier.

Which issue(s) this PR fixes:
Fixes #6973

Checklist

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

Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 18, 2025
Copy link
Member

@SungJin1212 SungJin1212 left a comment

Choose a reason for hiding this comment

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

LGTM, could you get the rebase?

@yeya24 yeya24 force-pushed the fix-remote-read-snappy-input-regression branch from e4665fc to d1eaf33 Compare September 18, 2025 16:01
@yeya24 yeya24 merged commit 8d15b2d into cortexproject:master Sep 18, 2025
18 checks passed
@yeya24 yeya24 deleted the fix-remote-read-snappy-input-regression branch September 24, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/query-frontend lgtm This PR has been approved by a maintainer size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Querier: Error while trying to remote-read "snappy: corrupt input"
3 participants