Revert Dual Endpoint Tracking#40451
Conversation
|
API change check API changes are not detected in this pull request. |
There was a problem hiding this comment.
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
sdk/cosmos/azure-cosmos/tests/test_service_retry_policies_async.py:386
- Verify that the expected number of request endpoints (4) now reflects the intended in-region retry behavior after the dual endpoint removal and that no necessary retries are inadvertently omitted.
assert len(connection_retry_policy.request_endpoints) == 4
sdk/cosmos/azure-cosmos/tests/test_fault_injection_transport.py:349
- Confirm that enabling multiple write locations in this test fully exercises the new code path and does not impact tests expecting single write location behavior when not explicitly enabled.
use_multiple_write_locations=True,
sdk/cosmos/azure-cosmos/azure/cosmos/_location_cache.py:59
- Ensure that downstream components correctly handle regional routing contexts that now contain only a primary endpoint, without relying on any alternate endpoint logic.
def get_regional_routing_contexts_by_loc(new_locations):
simorenoh
left a comment
There was a problem hiding this comment.
just a small comment but looks good otherwise - thanks Tomas!
…into tvaron3/revertDualEndpoint # Conflicts: # sdk/cosmos/azure-cosmos/azure/cosmos/_global_endpoint_manager.py # sdk/cosmos/azure-cosmos/azure/cosmos/_location_cache.py # sdk/cosmos/azure-cosmos/azure/cosmos/_request_object.py # sdk/cosmos/azure-cosmos/azure/cosmos/aio/_global_endpoint_manager_async.py # sdk/cosmos/azure-cosmos/tests/test_fault_injection_transport.py # sdk/cosmos/azure-cosmos/tests/test_fault_injection_transport_async.py # sdk/cosmos/azure-cosmos/tests/test_health_check.py # sdk/cosmos/azure-cosmos/tests/test_health_check_async.py
|
Hi @tvaron3. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Still working on this |
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
simorenoh
left a comment
There was a problem hiding this comment.
method def get_all_write_endpoints(self) -> Set[str]: still makes a reference to the alternate endpoint
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Allen Kim <allenkim0129@gmail.com>
Background
The SDK used to track two endpoints for writes. One was the global endpoint,
https://account.documents.azure.com, and the other was the regional endpointhttps://account-eastus.documents.azure.com. Gateway would return these randomly for the write region and the sdk would use that one to write and use the other endpoint as the backup. This was done for write availability in single write region accounts and for load balancing across compute federations.Changes
The dual endpoint logic is being abstracted away using a service called Azure Traffic Manager https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-overview. Gateway will now only send the regional endpoint to the sdk and the global endpoint should only be used for metadata calls in the sdk. This pr removes all the dual endpoint logic from the sdk and tests.
Other Changes
Simplified health check logic as no alternate endpoints to check anymore.
flowchart TD A[Request] --> B(fails due to connection issues) B --> C{ has there been 3 retries for this endpoint? } C --> K(Mark endpoint as unavailable) K -->|Yes| I{Is there another region/endpoint available?} I --> |No| J(Bubble up failure to customer) I --> |Yes| D[read or write request?] C -->|No| E(Retries in same region) E --> A D -->|Read| F(Retry on another region) D -->|Write| G{multi-write account?} G --> |Yes| F G --> |No| H(Retry on alternate endpoint) H --> A F --> A