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

Single Partition Queries that resume using continuation token after partition split can observe failure or sometimes wrong results on SDK v3.38 and beyond #4432

Closed
adityasa opened this issue Apr 18, 2024 · 2 comments
Assignees
Labels

Comments

@adityasa
Copy link
Contributor

adityasa commented Apr 18, 2024

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
This issue affects a limited set of queries on SDK v3.38 and beyond:

  • queries that target a single partition
  • queries that don't explicitly target a single partition, but collection itself has a single physical partition
    Such queries are executed using ODE codepath starting SDK v3.38 and beyond.

If a continuation token is acquired from such queries and queries are resumed using this continuation token after a partition split has occurred (which means they are no longer eligible for ODE codepath), the query execution fails with MalformedContinuationToken exception.

To Reproduce
Execute a query targeting single partition so that continuation token is produced. Capture the continuation token. Pause query execution. Make changes to collection such that partition split occurs. Resume the query execution.

Expected behavior
Query execution succeeds and correct results are returned.

Actual behavior
Error of following form is produced:
Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: BadRequest (400); Substatus: 20007; ActivityId: ; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 20007; ActivityId: ; Reason: (Invalid format for continuation token {"OptimisticDirectExecutionToken":{"token":". . .
In some rare cases error is not observed but the results may be incorrect.

Environment summary
SDK Version: v3.38 and beyond
OS Version (e.g. Windows, Linux, MacOSX)

Additional context

Mitigation
Turn off ODE for query execution. This can be done

@adityasa
Copy link
Contributor Author

This is being actively investigated.

@adityasa adityasa changed the title Single Partition Queries that resume using continuation token after partition split can observe failure on SDK v3.38 and beyond Single Partition Queries that resume using continuation token after partition split can observe failure or sometimes wrong results on SDK v3.38 and beyond Jun 7, 2024
@adityasa
Copy link
Contributor Author

adityasa commented Jun 7, 2024

This issue is fixed in v3.39.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant