-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
AddFeedRangeSupportInChangeFeed #36930
Merged
xinlian12
merged 22 commits into
Azure:users/xinlian/feature/feedRangeAndChangeFeed
from
xinlian12:addFeedRangeSupportInChangeFeed
Sep 16, 2024
Merged
AddFeedRangeSupportInChangeFeed #36930
xinlian12
merged 22 commits into
Azure:users/xinlian/feature/feedRangeAndChangeFeed
from
xinlian12:addFeedRangeSupportInChangeFeed
Sep 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
API change check APIView has identified API level changes in this PR and created following API reviews. |
xinlian12
commented
Aug 17, 2024
xinlian12
force-pushed
the
addFeedRangeSupportInChangeFeed
branch
from
August 18, 2024 01:21
a063d41
to
7a1a1eb
Compare
xinlian12
force-pushed
the
addFeedRangeSupportInChangeFeed
branch
2 times, most recently
from
August 18, 2024 18:59
63ea375
to
b9e66ae
Compare
xinlian12
force-pushed
the
addFeedRangeSupportInChangeFeed
branch
from
August 18, 2024 19:04
b9e66ae
to
5f16b14
Compare
jeet1995
reviewed
Aug 21, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_fetcher.py
Outdated
Show resolved
Hide resolved
annatisch
reviewed
Aug 21, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/feed_range_composite_continuation_token.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/feed_range_composite_continuation_token.py
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_fetcher.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/change_feed_fetcher.py
Outdated
Show resolved
Hide resolved
jeet1995
reviewed
Aug 22, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/aio/change_feed_fetcher.py
Outdated
Show resolved
Hide resolved
jeet1995
reviewed
Aug 22, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/aio/change_feed_iterable.py
Outdated
Show resolved
Hide resolved
jeet1995
reviewed
Aug 22, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/aio/change_feed_iterable.py
Show resolved
Hide resolved
jeet1995
reviewed
Aug 22, 2024
jeet1995
reviewed
Aug 22, 2024
sdk/cosmos/azure-cosmos/azure/cosmos/_change_feed/feed_range_composite_continuation_token.py
Show resolved
Hide resolved
xinlian12
requested review from
phermanov-msft,
ilyapaliakou-msft,
albertofori,
avanigupta,
mrm9084,
pvaneck,
xiangyan99,
a team,
luigiw,
needuv,
singankit,
lmazuel and
johanste
as code owners
September 13, 2024 21:53
xinlian12
requested review from
maorleger,
billwert,
g2vinay,
chlowell and
mpodwysocki
September 13, 2024 21:53
/azp run python - cosmos - tests |
/azp run python - cosmos - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
Failed tests are not caused by the change in the PR: test_user_agent_suffix_special_character |
/check-enforcer override |
xinlian12
merged commit Sep 16, 2024
f89b02b
into
Azure:users/xinlian/feature/feedRangeAndChangeFeed
8 of 13 checks passed
This was referenced Sep 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In this PR, we added support for getting the feedRanges of the container and added support for getting change feed by using feed ranges.
Getting feed ranges from container
feedRange
- represents a set of co-located logical partitions. For each container, customer will be able to get a list of feedRanges(each representing a hash-range of single physical partition). For query(future) and changeFeed(in this PR), SDK will allow customers to config a feedRange(can map to a single physical partition, span of multiple physical partitions or a subset of single physical partition) to filter the results.Examples:
created_collection.read_feed_ranges()
await created_collection.read_feed_ranges()
Adding feed range support in change feed query
There are few issues with current changeFeed query API:
Based on the above considerations, except adding feedRange support, we are also going to deprecate partition_key_range_id and is_start_from_beginning parameter. The API will be changed into the following:
Notes:
continuation token v1
-> old/existing formatted continuation token -> simple _lsn format, for example "3"continuation token v2
-> new formatted continuation token ,it will contain information including containerRid, changeFeed mode, changeFeed start from, and a list of continuationTokens for each sub-rangecontinuation token when filter by pk value
continuation token when filter by feed range
Split flow
Continuation token before split:
Continuation token after split:
What happens when query change feed from multiple partitions
The continuation token will contain a list of tokens for each partition, changes will be read from each partition in round-robin fashion.
using the continuation token from the above split example, it includes to tokens. one for range ["", 1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF), one for [1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, FF). It will read changes from
["", 1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF), then read changes from [1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, FF) and continue the pattern.
Future changes