-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Replace Endpoints with Regional Endpoints #39390
base: main
Are you sure you want to change the base?
Conversation
…morenoh/azure-sdk-for-python into service_response_error_policy
…morenoh/azure-sdk-for-python into tvaron3/regionalEndpoints
…to tvaron3/regionalEndpoints
API change check APIView has identified API level changes in this PR and created following API reviews. |
@@ -2038,7 +2038,8 @@ def PatchItem( | |||
if options is None: | |||
options = {} | |||
|
|||
headers = base.GetHeaders(self, self.default_headers, "patch", path, document_id, resource_type, options) | |||
headers = base.GetHeaders(self, self.default_headers, "patch", path, document_id, resource_type, |
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.
just curious - why all small letters (patch) when the OpType is defined with capital letters here. Don't we have to do case-insensitive comaprison due to it everywehre -
azure-sdk-for-python/sdk/cosmos/azure-cosmos/azure/cosmos/documents.py
Lines 347 to 364 in f2f1e98
class _OperationType: | |
"""Represents the type of the operation""" | |
Create: Literal["Create"] = "Create" | |
Delete: Literal["Delete"] = "Delete" | |
ExecuteJavaScript: Literal["ExecuteJavaScript"] = "ExecuteJavaScript" | |
Head: Literal["Head"] = "Head" | |
HeadFeed: Literal["HeadFeed"] = "HeadFeed" | |
Patch: Literal["Patch"] = "Patch" | |
Query: Literal["Query"] = "Query" | |
QueryPlan: Literal["QueryPlan"] = "QueryPlan" | |
Read: Literal["Read"] = "Read" | |
ReadFeed: Literal["ReadFeed"] = "ReadFeed" | |
Recreate: Literal["Recreate"] = "Recreate" | |
Replace: Literal["Replace"] = "Replace" | |
SqlQuery: Literal["SqlQuery"] = "SqlQuery" | |
Update: Literal["Update"] = "Update" | |
Upsert: Literal["Upsert"] = "Upsert" | |
Batch: Literal["Batch"] = "Batch" |
Azure Pipelines successfully started running 1 pipeline(s). |
except Exception as e: | ||
raise e | ||
|
||
for new_location in new_locations: |
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.
Use get() instead of location[""]
for example, all of these connection errors should be handled properly and can be safely retried in my opinion (more research required) https://docs.aiohttp.org/en/stable/client_reference.html#connection-errors Further client errors by aio http package -> https://docs.aiohttp.org/en/stable/client_reference.html#client-exceptions |
Description
The service will now start returning two endpoints for a region. A
GetDatabaseAccount
call used to get the following uri for a region test-account-name-westus.cosmos.documents.com. Now, it will randomly send variations of this endpoint. Ex:test-account-name-westus-1.cosmos.documents.com
,test-account-name-westus-2.cosmos.documents.com
. This is to improve availability in scenarios when gateway goes down.Implementation
Location cache will now have a new
RegionalEndpoint
object that will have a current and previous. The idea is the previous can be used in certain scenarios to retry.Pseudocode of new current and previous logic
Testing