-
Notifications
You must be signed in to change notification settings - Fork 502
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
Query Exceptionless Fix #999
Merged
Merged
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
bchong95
commented
Nov 15, 2019
...osoft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosOrderByItemQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
bchong95
commented
Nov 15, 2019
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CrossPartitionQueryTests.cs
Outdated
Show resolved
Hide resolved
bchong95
commented
Nov 15, 2019
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ItemProducerTreeUnitTests.cs
Outdated
Show resolved
Hide resolved
bchong95
commented
Nov 15, 2019
Microsoft.Azure.Cosmos/src/Query/Core/ItemProducerTree/ItemProducerTree.cs
Show resolved
Hide resolved
j82w
reviewed
Nov 15, 2019
j82w
reviewed
Nov 15, 2019
...soft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosParallelItemQueryExecutionContext.cs
Show resolved
Hide resolved
j82w
reviewed
Nov 15, 2019
...ft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosCrossPartitionQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
j82w
reviewed
Nov 15, 2019
...ft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosCrossPartitionQueryExecutionContext.cs
Show resolved
Hide resolved
...ft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosCrossPartitionQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
...osoft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosOrderByItemQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
...osoft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosOrderByItemQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
sboshra
reviewed
Nov 15, 2019
sboshra
reviewed
Nov 15, 2019
sboshra
reviewed
Nov 15, 2019
...ft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosCrossPartitionQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
sboshra
reviewed
Nov 15, 2019
...ft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosCrossPartitionQueryExecutionContext.cs
Outdated
Show resolved
Hide resolved
sboshra
previously approved these changes
Nov 15, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j82w
previously approved these changes
Nov 18, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create an issue to track removing the TestInjection class with mocking.
j82w
reviewed
Nov 18, 2019
...soft.Azure.Cosmos/src/Query/Core/ExecutionContext/CosmosParallelItemQueryExecutionContext.cs
Show resolved
Hide resolved
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.
Query Exceptionless Fix
Description
Bug
Queries were returning partial / inconsistent results when encountering 429s. The reason for this is that we were buffering exceptions and not setting the state correctly which ended up nulling out the continuation token. This ended up making the query iterator think that there was no more results instead of executing another roundtrip and getting back the 429.
Fix
For parallel (non order by) the fix was to just refactor the way we enumerate documents. The problem with parallel is that abstracted pages from the query pipeline which meant that parallel would always receive the next page of results when it got the end of one page. If that next page was a 429 we would buffer the 429 and send the results we have so far (but with a null continuation token). The solution was to return a continuation token at the end of each page and not buffer the 429. When the user comes back for the next page they will get the 429. ORDER BY was a trickier, since you will need to grab multiple pages in order to serve the sort order. For this I bit the bullet and returned the 429 and threw away any partial work. In the future we can add more buffering mechanisms to try and return the partial results.
Tests
None of the existing tests caught this situation. This is mainly because there are so many combinations that are hard to generate through unit tests. The fix was to wire through some test settings that will let the individual item producers know if we want to simulate edge cases like 429s and empty pages. From there the integration test hit all the failure cases.
Type of change
Please delete options that are not relevant.