Skip to content

[Cosmos] Add account-controlled availability strategy for PPAF - #50425

Draft
Abhijeet Mohanty (jeet1995) wants to merge 5 commits into
Azure:mainfrom
jeet1995:squad/ppaf-hedging-account-config
Draft

Abhijeet Mohanty (jeet1995) wants to merge 5 commits into
Azure:mainfrom
jeet1995:squad/ppaf-hedging-account-config

Conversation

@jeet1995

@jeet1995 Abhijeet Mohanty (jeet1995) commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

Add account-level control of availability strategy when PPAF is enabled.

  • Honor disableCrossRegionalHedging at bootstrap and on every account refresh, including hedging-only updates.
  • Suppress default and explicit hedging only while PPAF is enabled; preserve PPCB and timeout policies.
  • Expose the effective state in diagnostics without retaining the client or rebuilding PPCB configuration.
  • Include unit tests and nine live E2E scenarios for reads, readAll, readMany, queries, PPCB recovery, and PPAF-off precedence.

Related implementation: Azure/azure-cosmos-dotnet-v3#5829

Validation

  • RxDocumentClientImplTest: 10 tests passed in Maven unit verification.
  • Account-response wrapper: 8 invocations passed in Maven unit verification.
  • Clean reactor verification and git diff --check passed. Revapi emitted scanner exceptions for existing internal nested classes; API-analysis completeness is not established by build success.
  • Live multi-region E2E validation passed on de0cf5b: 18 tests, 0 failures, 0 errors, 0 skips, 0 flakes (Direct TCP and Gateway). Maven reactor verify completed with BUILD SUCCESS on 2026-09-11 at 19:38:32 -04:00. The query partitionKey/feedRange helper is repaired, and gateway cancellation records are preserved for non-hedged feeds. The six-case gateway cancellation regression and affected unit-test classes also pass. PR remains a draft as requested.

Live verification: run Maven verify -Pmulti-region with -Dit.test=PerPartitionAutomaticFailoverE2ETests#testAccountControlledHedgingFromBootstrap from sdk/cosmos, selecting azure-cosmos,azure-cosmos-test,azure-cosmos-tests with -am.

All SDK Contribution checklist:

  • No public API breaking changes introduced.
  • CHANGELOG updated.
  • Contribution guidelines read.

General Guidelines and Best Practices

  • Clear, informative title and scoped commits.

Testing Guidelines

  • Test coverage included.
  • Live multi-region E2E validation completed successfully on the latest revision.

Change-feed diagnostics regression follow-up

  • Commit c4f93d1 guards gateway cancellation diagnostics with per-subscription completion state. A downstream cancellation after a delivered 200/304 response no longer adds a synthetic timeout record; in-flight cancellations retain their diagnostics.
  • Reproduced the reported expected-one/actual-two record failure with three focused query/change-feed cases before applying the fix.
  • ChangeFeedTest.changeFeed_cosmosDiagnostics: 2 live cases passed (the test constructor creates an internal Gateway client; inherited report labels are misleading).
  • RxGatewayStoreModelTest and RxDocumentClientImplTest: 92 unit tests passed, with no failures or skips.
  • Shortened the serialized diagnostic key to isHedgingDisabledByAccount as requested.
  • Live PPAF matrix passed on c4f93d1: 18 tests, 0 failures, 0 errors, 0 skips, 0 flakes across Direct TCP and Gateway. Maven test-compile plus Failsafe integration-test/verify completed with BUILD SUCCESS on 2026-09-14 at 17:15:34 -04:00. Together with the 2 passing live change-feed diagnostics cases and 92 passing related unit tests, this validates the duplicate-diagnostics repair and shortened diagnostic key. PR remains a draft as requested.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
33 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jeet1995

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jeet1995

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jeet1995

Copy link
Copy Markdown
Member Author

/azp run java - cosmos - tests

@azure-pipelines

Copy link
Copy Markdown
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.

1 participant