Skip to content
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

PartitionKeyRangeCache should use NonBlockingAsyncCache #3060

Closed
j82w opened this issue Mar 2, 2022 · 0 comments · Fixed by #3080
Closed

PartitionKeyRangeCache should use NonBlockingAsyncCache #3060

j82w opened this issue Mar 2, 2022 · 0 comments · Fixed by #3080
Labels
feature-request New feature or request
Milestone

Comments

@j82w
Copy link
Contributor

j82w commented Mar 2, 2022

The PartitionKeyRangeCache is using the AsyncCache and is maps a CollectionRoutingMap to a Container RID. When there is a split or other scenario it will use change feed to only get the new partition key ranges and create a new CollectionRoutingMap by updating the values returned in the change feed.

The issue is if an exception occurs like a timeout or some other transient failure the entire CollectionRoutingMap was removed from the cache. This means if any transient failure occurs the SDK has to recreate the entire CollectionRoutingMap by reading the entire changefeed again. This now means that during a split if a transient issue occurs all requests are blocked until the new CollectionRoutingMap is created.

This problem is worse because user can currently disable 429 retries as described in #3055. If a 429 is hit the CollectionRoutingMap will be removed from the cache and it will to be built by reading all the ranges again.

Solution:
The PartitionKeyRangeCache should be converted to use the new NonBlockingAsyncCache which Address cache already uses.

Test Case:
If the container has 5 Partitions and a split occurs the 4 other partitions should always be accessible even if the call to get the new partitions fail or is slow.

@j82w j82w added the bug Something isn't working label Mar 2, 2022
@j82w j82w added this to the March 2022 milestone Mar 2, 2022
@j82w j82w added feature-request New feature or request and removed bug Something isn't working labels Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
1 participant