fix - full partition key routing bug#48237
Conversation
|
/azp run python - cosmos - tests |
|
@sdkReviewAgent-2 |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 8 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Restores partition-key routing for complete keys to prevent costly aggregate scans.
Changes:
- Routes complete keys through standard partition-key headers; retains EPK routing for HPK prefixes.
- Simplifies continuation-token handling.
- Adds sync/async regression, pagination, and routing tests.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Documents the routing fix. |
container.py |
Stops forwarding unnecessary container properties. |
_cosmos_client_connection.py |
Restores sync partition-key routing. |
aio/_cosmos_client_connection_async.py |
Adjusts async routing and continuation handling. |
_routing/feed_range_continuation.py |
Simplifies legacy-token policy. |
test_query.py |
Tests sync index-only COUNT. |
test_query_async.py |
Tests async index-only COUNT. |
test_query_feed_range_multipartition.py |
Tests sync continuation compatibility. |
test_query_feed_range_multipartition_async.py |
Tests async continuation compatibility. |
test_partition_split_retry_unit.py |
Verifies sync routing headers. |
test_partition_split_retry_unit_async.py |
Verifies async routing headers. |
test_feed_range_continuation_token.py |
Updates token-policy tests. |
|
✅ Review complete (26:59) Posted 3 inline comment(s). Steps: ✓ context, correctness, cross-sdk, design, history, past-prs, synthesis, test-coverage |
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
|
/azp run python - cosmos - tests |
|
@sdkReviewAgent-2 |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
[Pilot] PR Pipeline Failure AnalysisA CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green. What failedThe Use Python version task failed in the pipeline with an HTTP 504 (Gateway Timeout) error while trying to download Python 3.11 x64 from the GitHub Actions python registry. The macOS agent only has Build: https://dev.azure.com/azure-sdk/public/_build/results?buildId=6613916 Recommended next steps
Raw pipeline analysis (azsdk ci analyze)
|
|
✅ Review complete (50:29) Posted 3 inline comment(s). Steps: ✓ context, correctness, cross-sdk, design, history, past-prs, synthesis, test-coverage |
|
/azp run python - cosmos - tests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Bug: Single-partition queries that pass a complete partition_key stopped using partition-key routing and instead scanned the whole logical partition.
For a query like SELECT VALUE COUNT(1) with partition_key="PowerCut" , the SDK dropped the x-ms-documentdb-partitionkey header and instead sent an effective-partition-key (EPK) hash range via x-ms-documentdb-partitionkeyrangeid + x-ms-start-epk / x-ms-end-epk . That request shape loses the server-side index-only aggregate, so the service reads every document in the partition and returns them page by page.
See below issue for more details:
#48209