fix remote read snappy input due to empty request body #7025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]