-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Enable Request Level Excluded Locations to Metadata API calls #40905
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
Enable Request Level Excluded Locations to Metadata API calls #40905
Conversation
/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). |
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
API change check APIView has identified API level changes in this PR and created following API reviews. |
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
This PR enables request‐level excluded locations for metadata API calls in order to re‐route calls to non‐excluded locations and improve latency management. Key changes include updating live platform configuration, extending tests to validate metadata calls with excluded locations, and adjusting internal components (e.g. fault injection transport, location cache, routing providers) to handle excluded locations correctly.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sdk/cosmos/live-platform-matrix.json | Updated Windows image version and Python version for metadata tests. |
sdk/cosmos/azure-cosmos/tests/* | Updated tests to include request‐level excluded locations and revised client initialization with prefix partition keys. |
sdk/cosmos/azure-cosmos/tests/_fault_injection_transport_async.py | Updated fault injection transport for async operations. |
sdk/cosmos/azure-cosmos/tests/_fault_injection_transport.py | Updated fault injection transport for synchronous operations. |
sdk/cosmos/azure-cosmos/tests/test_config.py | Added configuration for multi-partition container with prefix partition keys. |
sdk/cosmos/azure-cosmos/azure/cosmos/* | Refactored functions to support excluded locations through feed options and updated internal helper methods. |
Comments suppressed due to low confidence (2)
sdk/cosmos/azure-cosmos/tests/_fault_injection_transport_async.py:50
- It appears the lambda incorrectly passes f['predicate'] instead of the request object. Update the lambda to use 'request' as the argument (e.g. lambda f: f'predicate').
matching_request_transformations = filter(lambda f: f["predicate"](f["predicate"]), iter(self.requestTransformations))
sdk/cosmos/azure-cosmos/tests/_fault_injection_transport.py:40
- The lambda for applying request transformations mistakenly passes f['predicate'] instead of the current request. It should be changed to pass 'request' (i.e. lambda f: f'predicate').
matching_request_transformations = filter(lambda f: f["predicate"](f["predicate"]), iter(self.requestTransformations))
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Thank you @allenkim0129 for the changes, they look good from overall point of view, however, I have couple of questions on the public surface APIs, let's discuss them before merging this in.
sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py
Outdated
Show resolved
Hide resolved
/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). |
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 a couple of comments, thanks Allen!
Description
Request level excluded locations were not available for nested metadata calls. This could cause potential latency issue with high demend locations. With this changes metadata calls will also be re-routed to non-excluded locations.
Changes
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines