Skip to content

Conversation

@mbhaskar
Copy link
Member

Description

This PR does the following:

  • Adding nregion feature to changelog
  • Always parsing nregion header in storeresult

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

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.

- Always parsing nregion header in storeresult
Copilot AI review requested due to automatic review settings February 12, 2026 00:53
@mbhaskar mbhaskar requested review from a team and kirankumarkolli as code owners February 12, 2026 00:53
Copy link
Contributor

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

This PR updates the Cosmos Java SDK to better support the N-Region synchronous commit feature by ensuring the N-Region global committed GLSN header is parsed into StoreResult, and documents the feature addition in the Cosmos changelog.

Changes:

  • Always parse x-ms-cosmos-global-nregion-committed-glsn into StoreResult (including for exception responses).
  • Add a changelog entry advertising N-Region synchronous commit support for the upcoming beta release.

Reviewed changes

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

File Description
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/StoreReader.java Parse and propagate the N-Region committed GLSN header into StoreResult for the exception path.
sdk/cosmos/azure-cosmos/CHANGELOG.md Document N-Region synchronous commit support under the next unreleased beta version.

Comment on lines +1004 to 1007
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_N_REGION_COMMITTED_GLSN);
if (!Strings.isNullOrEmpty(headerValue)) {
globalNRegionCommittedLSN = Long.parseLong(headerValue);
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The change now always reads GLOBAL_N_REGION_COMMITTED_GLSN from CosmosException response headers, but there doesn’t appear to be unit test coverage validating StoreResult.globalNRegionCommittedLSN is populated for the exception path (including when both GLOBAL_COMMITTED_LSN and GLOBAL_N_REGION_COMMITTED_GLSN are present). Please add/extend a unit test (e.g., in StoreReaderTest) that constructs a CosmosException with these headers and asserts the resulting StoreResult fields.

Copilot generated this review using guidance from repository custom instructions.
### 4.79.0-beta.1 (Unreleased)

#### Features Added
* Added support for N-Region synchronous commit feature - See [PR 47757](https://github.com/Azure/azure-sdk-for-java/pull/47757)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The PR description still contains the template instruction text (“Please add an informative description… and link all relevant issues.”). Please replace that with an actual summary/repro/verification notes and any linked issues so the changelog entry and code change are properly traceable.

Copilot uses AI. Check for mistakes.
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants