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

[Cosmos] Change default consistency level to the database account consistency level #22792

Merged
merged 24 commits into from
Feb 3, 2022
Merged

[Cosmos] Change default consistency level to the database account consistency level #22792

merged 24 commits into from
Feb 3, 2022

Conversation

simorenoh
Copy link
Member

These changes make it so the default consistency level that gets set when initializing clients becomes that of the database account, as opposed to the previous default (which was just "Session").

With these changes, the user can be sure that if they don't pass in a given consistency level their clients will run using the one present in their cosmos account. This also makes it easier for users seeking to try the dedicated gateway/ integrated cache since they won't have to specify for the clients to have a specific consistency when their account is set up to use these new features.

@simorenoh simorenoh added Cosmos Client This issue points to a problem in the data-plane of the library. Do Not Merge cosmos-v4-python labels Jan 27, 2022
@azure-sdk
Copy link
Collaborator

API changes have been detected in azure-cosmos. You can review API changes here

@azure-sdk
Copy link
Collaborator

API changes have been detected in azure-cosmos. You can review API changes here

@simorenoh simorenoh changed the title [Cosmos] consistency level gets set to default found in database account [Cosmos] Change default consistency level to the database account consistency level Jan 27, 2022
@simorenoh simorenoh marked this pull request as ready for review January 27, 2022 16:54
@simorenoh simorenoh requested a review from annatisch January 27, 2022 16:54
@simorenoh
Copy link
Member Author

/azp run python - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@simorenoh
Copy link
Member Author

@check-enforcer
Copy link

check-enforcer bot commented Feb 2, 2022

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run python - [service] - ci

@simorenoh
Copy link
Member Author

/azp run python - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@xinlian12 xinlian12 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@simorenoh simorenoh merged commit 41d5287 into Azure:main Feb 3, 2022
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Apr 10, 2022
…sistency level (Azure#22792)

* consistency level gets set to default found in database account

* async client default change

* updated docs based on finding and updated samples to reflect best practices

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Update README.md

* Update CHANGELOG.md

* formatting

* formatting

* updated consistency for first request to Eventual (lowest latency)

* pylint

* from_connection_string methods

* from_connection_string2

* Update sdk/cosmos/azure-cosmos/README.md

Co-authored-by: Gahl Levy <[email protected]>

* Apply suggestions from code review

Co-authored-by: Gahl Levy <[email protected]>

* Update README.md

* removed forceful header usage, changed setup to only check for Session consistency to start client session

* need to set header if Session consistency  for updating session if needed (thanks Jake!)

* Apply suggestions from code review

Kushagra improved documentation and comments

Co-authored-by: Kushagra Thapar <[email protected]>

* added test for session token

* Update CHANGELOG.md

* Update _cosmos_client_connection_async.py

Co-authored-by: Gahl Levy <[email protected]>
Co-authored-by: Kushagra Thapar <[email protected]>
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-python that referenced this pull request Feb 28, 2023
{AzureMonitor} fixes Azure/azure-rest-api-specs#22716 fix the Metrics API version in the package-composite-v1 tag (Azure#22792)

fixes Azure/azure-rest-api-specs#22716 

fix the Metrics API version in the package-composite-v1 tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants