-
Notifications
You must be signed in to change notification settings - Fork 494
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
[Internal] Query : Fixes response parsing error for ReadFeed by limiting binary format to query operations #4515
Merged
microsoft-github-policy-service
merged 8 commits into
master
from
users/adityasa/LimitBinaryToQueryOperations
May 29, 2024
Merged
[Internal] Query : Fixes response parsing error for ReadFeed by limiting binary format to query operations #4515
microsoft-github-policy-service
merged 8 commits into
master
from
users/adityasa/LimitBinaryToQueryOperations
May 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pilchie
reviewed
May 25, 2024
ealsur
reviewed
May 28, 2024
Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs
Outdated
Show resolved
Hide resolved
adityasa
commented
May 28, 2024
...Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj
Show resolved
Hide resolved
ealsur
approved these changes
May 28, 2024
adityasa
requested review from
khdang,
sboshra,
neildsh,
kirankumarkolli and
kirillg
as code owners
May 28, 2024 20:56
Maya-Painter
approved these changes
May 29, 2024
microsoft-github-policy-service
bot
deleted the
users/adityasa/LimitBinaryToQueryOperations
branch
May 29, 2024 03:16
adityasa
added a commit
that referenced
this pull request
Jun 7, 2024
…ing binary format to query operations (#4515) * Limit binary format to query operations * Addressed comments, updated test. * Updated coverage to include query stream API. * Test Change. * Test change 2 * ReadFeed Encryption tests only with project reference * Revert * Removed comment --------- Co-authored-by: Matias Quaranta <[email protected]>
This was referenced Jun 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Template
Description
This change restricts use of SupportedSerializationFormats header to query scenarios only. Technically, this header is only used by QueryRequestOptions, however, the QueryRequestOptions (and therefore this header) also get invoked for ReadFeed. There is no direct API for ReadFeed, instead any of the query APIs (GetItemLinqQueryable, GetItemQueryIterator, GetItemStreamQueryIterator) invoke ReadFeed operation (instead of Query operation) if supplied query (or QueryDefinition) is null.
ReadFeed API in the backend currently doesn't support this header and returns the response in text. However as it turns out, if this API is invoked with a specific partition key in the request options, backend honors the header. This is an issue, since SDK doesn't support handling of binary response in ReadFeed codepath.
As a result, when query APIs are invoked with query = null and a specific partition key, response cannot be parsed successfully. The issue is recently discovered after new emulator is published, which enabled binary encoding by default (when /EnablePreview flag is supplied). The issue was discovered in the form of test failures in the pipeline (which uses latest emulator with EnablePreview flag).
Currently following tests are failing:
EncryptionCreateItemAndQuery
ValidateSupportedSerializationFormatsRntbd
ValidateSupportedSerializationFormatsGateway
This change fixes following tests:
ValidateSupportedSerializationFormatsRntbd
ValidateSupportedSerializationFormatsGateway
The encryption project does not use the SDK code from master (by referencing project), but rather released SDK v3.35.4. The failing portion of the EncryptionCreateItemAndQuery test is made conditional, by only allowing to run when SDK project is referenced.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber