-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Bug] CFP Skipping Changes #43788
base: main
Are you sure you want to change the base?
[Bug] CFP Skipping Changes #43788
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
…to tvaron3/changeFeedExhaustedRUs
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
...c/test/java/com/azure/cosmos/rx/changefeed/pkversion/IncrementalChangeFeedProcessorTest.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosContainerChangeFeedTest.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosContainerChangeFeedTest.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosContainerChangeFeedTest.java
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 - left behind some nit comments.
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 - thanks Tomas!
One small non-blocking nit: it would be good to have a test to validate that CFP does not skip records when used with HPK (after HPK is enabled for CFP). I am not sure if HPK is supported for leases, but just a thought.
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Change Feed Processor could skip records if there is throttling on the lease container and some other timing conditions. Change Feed keeps running after receiving a page and attempts to acquire all results. The continuation token gets updated and because it is a shared reference between change feed fetcher and partition processor, some records get skipped without being returned. Additionally, Change Feed Processor is not limiting one request at a time.
Solution
Create a deep copy of the CosmosChangeFeedRequestOptions. Moving the take(1, true) call down to the queryChangeFeed call to correctly only prefetch one page at a time.
Testing
Validated change by using queryChangeFeed with and without take(1,true)
More context: #43701