-
Notifications
You must be signed in to change notification settings - Fork 2.1k
changeToUseChangeFeedToFetchPkRanges #46810
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
Conversation
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 enhances the partition key range fetching mechanism by switching from regular queries to change feed queries, improving diagnostics tracking, and modifying retry policy application.
Key changes:
- Switch to change feed approach for fetching partition key ranges to enable incremental updates
- Fix incorrect end time tracking in CosmosDiagnostics for PARTITION_KEY_RANGE_LOOK_UP operations
- Apply throttling retry policy per page instead of across all pages
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| InMemoryCollectionRoutingMap.java | Added change feed continuation token support and logging |
| CollectionRoutingMap.java | Extended interface to support change feed continuation tokens |
| RxPartitionKeyRangeCache.java | Refactored to use change feed for partition key range fetching with proper diagnostics timing |
| RxDocumentClientImpl.java | Modified to support change feed headers and per-request retry policy |
| Paginator.java | Added change feed flag parameter |
| DocumentProducer.java | Updated method call to include change feed flag |
| DefaultDocumentQueryExecutionContext.java | Updated method call to include change feed flag |
| Multiple test files | Updated method signatures and test data to accommodate new parameters |
...smos/src/main/java/com/azure/cosmos/implementation/routing/InMemoryCollectionRoutingMap.java
Outdated
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/caches/RxPartitionKeyRangeCache.java
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/caches/RxPartitionKeyRangeCache.java
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/caches/RxPartitionKeyRangeCache.java
Show resolved
Hide resolved
...re-cosmos/src/main/java/com/azure/cosmos/implementation/caches/RxPartitionKeyRangeCache.java
Outdated
Show resolved
Hide resolved
…ntation/routing/InMemoryCollectionRoutingMap.java Co-authored-by: Copilot <[email protected]>
…ntation/caches/RxPartitionKeyRangeCache.java Co-authored-by: Copilot <[email protected]>
e2eaac0 to
ee9cba9
Compare
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...smos/src/main/java/com/azure/cosmos/implementation/routing/InMemoryCollectionRoutingMap.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Outdated
Show resolved
Hide resolved
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...re-cosmos/src/main/java/com/azure/cosmos/implementation/caches/RxPartitionKeyRangeCache.java
Show resolved
Hide resolved
...zure-cosmos/src/main/java/com/azure/cosmos/implementation/InCompleteRoutingMapException.java
Show resolved
Hide resolved
...os/src/main/java/com/azure/cosmos/implementation/caches/InCompleteRoutingMapRetryPolicy.java
Outdated
Show resolved
Hide resolved
FabianMeiswinkel
left a comment
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.
LGTM now with the validation of incomplete routng maps - Thin Client team by the way found an instance where container returned incomplete routing map last week - so, definitely worth the effort! Have a few comments around logging and reason for blockign is that I don't understand why failure would map to 404 (vs. 503)
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
FabianMeiswinkel
left a comment
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.
LGTM - Thanks
Changes included: