-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Default enablement of Threshold-Based Availability Strategy with Per-Partition Automatic Failover. #45267
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
base: main
Are you sure you want to change the base?
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.
Pull Request Overview
This pull request enables a threshold‐based availability strategy for reads when Per-Partition Automatic Failover (PPAF) is enabled. Key changes include adding new duration constants and a helper method in Utils, updating RxDocumentClientImpl to propagate the end-to-end policy configuration, and introducing new configuration properties and test validations for the strategy.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java | Added duration constants and a min utility function to support latency configuration. |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java | Updated multiple methods to pass an end-to-end policy configuration and added a new helper to apply the latency policy. |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java | Introduced new config properties and a method to check if the read availability strategy is enabled with PPAF. |
sdk/cosmos/azure-cosmos/docs/TimeoutAndRetriesConfig.md | Documented the new threshold strategy defaults for PPAF. |
sdk/cosmos/azure-cosmos/CHANGELOG.md | Updated the changelog to include the new availability strategy feature. |
sdk/cosmos/azure-cosmos-tests/ | Updated tests to validate the new strategy behavior under fault injection scenarios. |
Comments suppressed due to low confidence (1)
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java:227
- The delay has been increased from 10,000 milliseconds to 10,000 seconds and the repetition count changed from 1 to 10,000, which may lead to unintended long delays. Please verify that these values are intended.
.delay(Duration.ofSeconds(10000))
...cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/EndToEndTimeOutValidationTests.java
Outdated
Show resolved
Hide resolved
…ableAvailabilityStrategyWithPPAF
API change check API changes are not detected in this pull request. |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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!
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
/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). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
As title.
With default enablement of Threshold-Based Availability Strategy with Per-Partition Automatic Failover enablement, reads and queries will be hedged to second preferred region onwards.
The defaults to hedging are
1s
to the second preferred region and then500ms
to reach out to the third preferred region and so on.A customer can choose to opt out of this through the following system property
[or] set
COSMOS_IS_READ_AVAILABILITY_STRATEGY_ENABLED_WITH_PPAF
environment variable tofalse
.A customer can choose to override above defaults by configuring
CosmosEndToEndLatencyPolicyConfig
at request options level orCosmosClientBuilder
. See below:All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines