Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 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.

#### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ StoreResult createStoreResult(StoreResponse storeResponse,
int numberOfReadRegions = -1;
Double backendLatencyInMs = null;
Double retryAfterInMs = null;
long globalNRegionCommittedLSN = -1;

if (replicaStatusList != null) {
ImplementationBridgeHelpers
Expand Down Expand Up @@ -995,15 +996,14 @@ StoreResult createStoreResult(StoreResponse storeResponse,
numberOfReadRegions = Integer.parseInt(headerValue);
}

long globalNRegionCommittedLSN = -1;
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_COMMITTED_LSN);
if (!Strings.isNullOrEmpty(headerValue)) {
globalCommittedLSN = Long.parseLong(headerValue);
} else {
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_N_REGION_COMMITTED_GLSN);
if (!Strings.isNullOrEmpty(headerValue)) {
globalNRegionCommittedLSN = Long.parseLong(headerValue);
}
}

headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_N_REGION_COMMITTED_GLSN);
if (!Strings.isNullOrEmpty(headerValue)) {
globalNRegionCommittedLSN = Long.parseLong(headerValue);
}
Comment on lines +1004 to 1007
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.

headerValue = cosmosException.getResponseHeaders().get(HttpConstants.HttpHeaders.BACKEND_REQUEST_DURATION_MILLISECONDS);
Expand Down
Loading