Skip to content

Adding effective ReadConsistencyStrategy to CosmosDiagnosticsContext #45414

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

FabianMeiswinkel
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel commented May 20, 2025

Description

This PR adds information about the effective read consistency startegy used to the CosmosDiagnosticsContext to improve diagnostics. It also fixes a few test issues (flakiness etc.) identified in the CI pipeline executions validating the change.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 23:09
@FabianMeiswinkel FabianMeiswinkel requested review from kirankumarkolli and a team as code owners May 20, 2025 23:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The purpose of this PR is to add support for an effective ReadConsistencyStrategy in CosmosDiagnosticsContext and related diagnostics code.

  • Added a new ReadConsistencyStrategy parameter to methods that create or manipulate CosmosDiagnosticsContext.
  • Updated FeedOperationState, DiagnosticsProvider, CosmosAsyncContainer, and CosmosAsyncClient to incorporate read consistency strategy logic.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ImplementationBridgeHelpers.java Added ReadConsistencyStrategy parameter to create method and interface definition.
FeedOperationState.java Extracted and computed effective read consistency strategy from request options.
DiagnosticsProvider.java Propagated read consistency strategy from request options to diagnostics context.
CosmosDiagnosticsContext.java Stored and exposed the read consistency strategy with added null-check and toString logging.
CosmosAsyncContainer.java Passed effective read consistency strategy from request options into policy application.
CosmosAsyncClient.java Added logic for determining effective read consistency strategy under various conditions.

Copy link
Contributor

github-actions bot commented May 20, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-cosmos

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - tests

1 similar comment
@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@xinlian12 xinlian12 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 :)

Copy link
Member

@xinlian12 xinlian12 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 :)

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - tests

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - kafka

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

2 similar comments
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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