Skip to content

Commit 606d04a

Browse files
authored
- Adding nregion feature to changelog (#47987)
- Always parsing nregion header in storeresult
1 parent e1af15d commit 606d04a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

sdk/cosmos/azure-cosmos/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### 4.79.0-beta.1 (Unreleased)
44

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

78
#### Breaking Changes
89

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/StoreReader.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ StoreResult createStoreResult(StoreResponse storeResponse,
948948
int numberOfReadRegions = -1;
949949
Double backendLatencyInMs = null;
950950
Double retryAfterInMs = null;
951+
long globalNRegionCommittedLSN = -1;
951952

952953
if (replicaStatusList != null) {
953954
ImplementationBridgeHelpers
@@ -995,15 +996,14 @@ StoreResult createStoreResult(StoreResponse storeResponse,
995996
numberOfReadRegions = Integer.parseInt(headerValue);
996997
}
997998

998-
long globalNRegionCommittedLSN = -1;
999999
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_COMMITTED_LSN);
10001000
if (!Strings.isNullOrEmpty(headerValue)) {
10011001
globalCommittedLSN = Long.parseLong(headerValue);
1002-
} else {
1003-
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_N_REGION_COMMITTED_GLSN);
1004-
if (!Strings.isNullOrEmpty(headerValue)) {
1005-
globalNRegionCommittedLSN = Long.parseLong(headerValue);
1006-
}
1002+
}
1003+
1004+
headerValue = cosmosException.getResponseHeaders().get(WFConstants.BackendHeaders.GLOBAL_N_REGION_COMMITTED_GLSN);
1005+
if (!Strings.isNullOrEmpty(headerValue)) {
1006+
globalNRegionCommittedLSN = Long.parseLong(headerValue);
10071007
}
10081008

10091009
headerValue = cosmosException.getResponseHeaders().get(HttpConstants.HttpHeaders.BACKEND_REQUEST_DURATION_MILLISECONDS);

0 commit comments

Comments
 (0)