[Hotfix-Preview] Query: Adds environment variable for overriding EnableOptimisticDirectExecution default #4312
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
Cherry-pick of following PR from master:
This change adds an ability to override the default value of EnableOptimisticDirectExecution setting using an environment variable named
AZURE_COSMOS_OPTIMISTIC_DIRECT_EXECUTION_ENABLED
.The environment variable should have a value that can be parsed as a
Boolean
in order for the override to work.As before the default value is true and also the backend setting using
clientDisableOptimisticDirectExecution
acts as a master switch and acts as global account-level override to disable/enable ODE behavior (in clients).The environment variable can be used while upgrading the sdk package to 3.38 onwards, which turns on ODE by default. As mentioned in the release notes (of
3.38.0
), due to the use of a new type of continuation token, applications that execute queries (and their continuations) in a stateless manner on machines that can be using different versions of sdk, failures can be observed.This environment variable can be set to true before upgrading the sdk package to avoid such failures during the sdk deployment process in production environment. Once the upgrade is complete the environment variable can be removed or set to false.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber