Skip to content
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

ChangeFeedDiagnosticsFix #41698

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

xinlian12
Copy link
Member

@xinlian12 xinlian12 commented Aug 31, 2024

Issue:
CosmosDiagnostics is accumulating across all requests in change feed query.
For example, with the following code snippet:

CosmosChangeFeedRequestOptions changeFeedRequestOptions = CosmosChangeFeedRequestOptions.createForProcessingFromBeginning(FeedRange.forFullRange());
        Iterator<FeedResponse<JsonNode>> results =
            container.queryChangeFeed(changeFeedRequestOptions, JsonNode.class)
            .iterableByPage()
            .iterator();

        while (results.hasNext()) {
            logger.info(results.next().getCosmosDiagnostics());
        }

First request diagnostics:
image
Second request diagnostics:
image

Root cause:
Same FeedRangeContinuationFeedRangeGoneRetryPolicy/ClientRetryPolicy is being used across all requests.

Fix:
Using different FeedRangeContinuationFeedRangeGoneRetryPolicy for each page request.

@xinlian12 xinlian12 requested review from kirankumarkolli and a team as code owners August 31, 2024 18:06
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@xinlian12
Copy link
Member Author

/azp run java - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xinlian12
Copy link
Member Author

/azp run java - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jeet1995 jeet1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@xinlian12 xinlian12 merged commit 5a8195f into Azure:main Sep 5, 2024
79 checks passed
jairmyree pushed a commit to jairmyree/azure-sdk-for-java that referenced this pull request Sep 23, 2024
* fix cosmos diagnostics issue in changeFeed

---------

Co-authored-by: annie-mac <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants