ChangeFeedIterator gets stuck on multihashed containers for prefix partitions keys that span multiple physical partitions.
See original GitHub issueDescribe the bug
When reading the ChangeFeed
for a prefix partition key that spans multiple physical partitions the ChangeFeed
will not be able to handle the partition split and will get stuck in an infinite loop.
Expected behavior Results should be returned.
Actual behavior
ReadNextAsync
becomes stuck in an infinite loop.
// Create Container Hierarchical PartitionKeys
this.containerProperties = new ContainerProperties("mycoll", new List<string> { "/State", "/City", "/ZipCode" });
this.container = await database.CreateContainerAsync(this.containerProperties);
// ...
//Container is then filled with enough items span multiple physical partitions
// ...
//Create a Prefix PartitionKey
Cosmos.PartitionKey prefixPK = new PartitionKeyBuilder().Add("Redmound").Build();
//Create ChangeFeedIterator
FeedRange feedRange = FeedRange.FromPartitionKey(shardPartitionKey);
FeedIterator<dynamic> feedIterator = container.GetChangeFeedIterator<dynamic>(ChangeFeedStartFrom.Beginning(shardFeedRange), ChangeFeedMode.Incremental, new ChangeFeedRequestOptions() { PageSizeHint = 10 });
while (feedIterator .HasMoreResults)
{
FeedResponse<dynamic> response = await feedIterator .ReadNextAsync(); // BUG: Code gets stuck here!
}
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Hierarchical partition keys - Azure Cosmos DB
Azure Cosmos DB distributes your data across logical and physical partitions based on your partition keys to support horizontal scaling.
Read more >Partitioning and horizontal scaling - Azure Cosmos DB
A container is scaled by distributing data and throughput across physical partitions. Internally, one or more logical partitions are mapped to a ...
Read more >Azure cosmos DB physical partition unbalanced with no ...
I have this problem: new physical partitions are being created for me and requests often occur on the same partition. I wonder how...
Read more >Sneak peek: new hierarchical partitioning for Azure Cosmos DB
We will talk about what hierarchical partitioning is, ... If you build multi -tenant apps on Azure Cosmos DB or use synthetic partitions...
Read more >Leveraging Hierarchical Partition Keys in Azure Cosmos DB
The property is used to group documents with the same value together in the same logical partition.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Working on a hotfix now, should be out next week.
Issue is fixed with latest release of the SDK (3.35.0)