-
Notifications
You must be signed in to change notification settings - Fork 494
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
CFP AVAD: Adds Container IsFeedRangePartOfAsync support for FeedRange #4566
CFP AVAD: Adds Container IsFeedRangePartOfAsync support for FeedRange #4566
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.
All good!
…titionKey and FeedRange.
…MSFT/add_feedranges_to_avad_contract
Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Kiran Kumar Kolli <[email protected]>
…ems.cs Co-authored-by: Kiran Kumar Kolli <[email protected]>
…' of https://github.com/Azure/azure-cosmos-dotnet-v3 into users/philipthomas-MSFT/add_feedranges_to_avad_contract # Conflicts: # Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
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
Microsoft.Azure.Cosmos.Encryption.Custom/src/EncryptionContainer.cs
Outdated
Show resolved
Hide resolved
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 except for the two NITs
4ebbad9
Pull Request Template
Description
Details #4483
The customer wants to validate if one FeedRange is a subset of another FeedRange. This means checking if all the data in the y FeedRange is entirely within the boundaries of the x FeedRange, ensuring that no data is processed twice or skipped. It is understood that FeedRange could also be represented by a PartitionKey or FeedRangeEpk.
API
Levelsetting
Container
Diagram 1: Final state of PR
FeedRange
https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.feedrange?view=azure-dotnet
A FeedRange in Azure Cosmos DB represents a segment of data, often based on partition keys, that can be processed or monitored. FeedRanges are typically used in the context of change feed processing to allow multiple workers to consume data in parallel by splitting the container’s data into smaller, manageable pieces. Each FeedRange corresponds to a specific partition key range.
Min: Lower boundary of a range
Max Upper boundary of a range
IsMinInclusive: Is the lower boundary inclusive or exclusive?
IsMaxInclusive: Is the upper boundary inclusive or exclusive?
"MaxExclusive": The upper boundary of a range is exclusive; the range does not include the maximum value itself.
Examples based on unit tests
FeedRange
A FeedRange represents a segment of data that can be processed or read in parallel. FeedRanges can be used with or without partition keys, depending on the context. They are especially useful in change feed processing, where multiple workers can process different ranges in parallel.
Hierarchical PartitionKey
In hierarchical partitioning, the partition key is composed of multiple levels (or paths), which can be combined in a hierarchical manner. This means that data is partitioned based on a combination of keys, such as {"region": "US", "userId": "123"}, which makes the partitioning more granular and allows for more specific partition key ranges.
Partition Key
In non-hierarchical partitioning, the partition key is a single value (or path). For instance, a partition key might be {"userId": "123"}. Data is distributed based solely on this one-dimensional key.
Invalid FeedRangeEpk with IsMinInclusive: false throws ArgumentOutOfRangeException
FeedRangeEpk is a more specific form of FeedRange that focuses on effective partition keys (EPK), which represent the internal structure of how data is distributed across partitions in Azure Cosmos DB.
FeedRangeEpk targets specific physical partitions, and these boundaries are managed internally by Cosmos DB. These boundaries are fixed based on the hash values of the partition keys and are not modifiable by the user. As a result, there is no need for the notion of inclusivity, because the partition boundary is rigid and defined by the physical partition structure, not by a logical partition key.
EnsureConsistentInclusitivy
Validates if all ranges in the list have consistent inclusivity for both IsMinInclusive and IsMaxInclusive boundaries.
Throws an InvalidOperationException if there are inconsistencies.
IsSubset
Determines whether the y range is a subset of the x range.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #4483