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

[Internal] Query: Adds support for binary encoded ReadFeed and Read responses #4516

Closed
wants to merge 9 commits into from

Conversation

Maya-Painter
Copy link
Contributor

@Maya-Painter Maya-Painter commented May 29, 2024

Description

This PR adds support for binary encoded ReadFeed responses.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

All good!

@Maya-Painter Maya-Painter changed the title Adds support for binary encoded ReadFeed responses [Internal] ReadFeed: Adds support for binary encoded ReadFeed responses May 29, 2024
@Maya-Painter Maya-Painter changed the title [Internal] ReadFeed: Adds support for binary encoded ReadFeed responses [Internal] Query: Adds support for binary encoded ReadFeed responses May 29, 2024
@@ -241,7 +241,7 @@ internal override void PopulateRequestOptions(RequestMessage request)
// All query APIs (GetItemQueryIterator, GetItemLinqQueryable and GetItemQueryStreamIterator) turn into ReadFeed operation if query text is null.
// In such a case, query pipelines are still involved (including QueryRequestOptions). In general backend only honors SupportedSerializationFormats
// for OperationType Query but has a bug where it returns a binary response for ReadFeed API when partition key is also specified in the request.
if (request.OperationType == OperationType.Query)
if (request.OperationType == OperationType.Query || request.OperationType == OperationType.ReadFeed)
Copy link
Contributor

Choose a reason for hiding this comment

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

This would require a few test updates. Kindly confirm (otherwise I am guessing we would have test gaps).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is passing all gates. Which tests are you thinking about in particular? Before the rewrite there were multiple readfeed failures (same as we saw when the emulator was first upgraded).

@Maya-Painter Maya-Painter changed the title [Internal] Query: Adds support for binary encoded ReadFeed responses [Internal] Query: Adds support for binary encoded ReadFeed and Read responses May 30, 2024
@@ -293,6 +294,11 @@ internal class RequestInvokerHandler : RequestHandler
{
request.Headers.ContentType = RuntimeConstants.MediaTypes.JsonPatch;
}
else if (operationType == OperationType.Read)
{
request.Headers.CosmosMessageHeaders.SupportedSerializationFormats = DocumentQueryExecutionContextBase.DefaultSupportedSerializationFormats;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently SupportedSerializationFormats header isn't honored by backend for read operations, even though it is expected to. Using ContentSerializationFormat for testing for now.

Copy link
Member

Choose a reason for hiding this comment

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

@Maya-Painter - Shivam merged a PR for this a while back (several weeks) - did you test this against a prod account or emulator - and if emulator with /EnablePreview or without?

Copy link
Contributor Author

@Maya-Painter Maya-Painter May 30, 2024

Choose a reason for hiding this comment

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

Tested on both a prod account and the newest emulator with /EnablePreview and got the same result. I've looked at Shivam's change and I see no reason why it shouldn't work, so this is surprising. I assume the change should have been picked up in the newest emulator? @FabianMeiswinkel

@Maya-Painter Maya-Painter marked this pull request as draft May 30, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants