question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChangeFeedIterator gets stuck on multihashed containers for prefix partitions keys that span multiple physical partitions.

See original GitHub issue

Describe 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:closed
  • Created 4 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NaluTripiciancommented, May 25, 2023

Hi, any updates on this? Thanks!

Working on a hotfix now, should be out next week.

0reactions
NaluTripiciancommented, Jun 20, 2023

Issue is fixed with latest release of the SDK (3.35.0)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found