Azure / azure-cosmos-dotnet-v3

.NET SDK for Azure Cosmos DB for the core SQL API
MIT License
723 stars 477 forks source link

Query: Fixes Persisted continuationToken issue by turning off ODE by default #4413

Closed adityasa closed 2 months ago

adityasa commented 2 months ago

Pull Request Template

Description

This change fixes the issue with persisted continuation tokens by turning off ODE by Default. The issue is hit by DataVerse team where continuation tokens for a given query are persisted for long periods of time. If query that originally started with ODE resumes execution after partition split has occurred, it currently fails with following error message: 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":"{"OptimisticDirectExecutionToken". . .

Currently this issue is tracked by https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4432, however the fix for that issue is much more involved, since it requires hydrate a continuation token required by non-ODE pipelines from original ODE continuation token.

As a mitigation, this change turns off ODE by default, unless a continuation of an ODE query is being executed.

Type of change

Please delete options that are not relevant.

Closing issues

To automatically close an issue: closes #IssueNumber

adityasa commented 2 months ago

/azp run

azure-pipelines[bot] commented 2 months ago
Azure Pipelines successfully started running 1 pipeline(s).