Skip to content
Closed
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
10 changes: 8 additions & 2 deletions Microsoft.Azure.Cosmos/src/DocumentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6797,7 +6797,12 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory
}

private void CreateStoreModel(bool subscribeRntbdStatus)
{
{
AccountProperties accountProperties = this.accountServiceConfiguration.AccountProperties;

bool enableNRegionSynchronousCommit = accountProperties.EnableNRegionSynchronousCommit;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be more than a boolean flag (instead an absolute number of regions that must have committed)?

AccountConfigurationProperties accountConfigurationProperties = new (EnableNRegionSynchronousCommit: enableNRegionSynchronousCommit);

//EnableReadRequestsFallback, if not explicity set on the connection policy,
//is false if the account's consistency is bounded staleness,
//and true otherwise.
Expand All @@ -6812,7 +6817,8 @@ private void CreateStoreModel(bool subscribeRntbdStatus)
this.UseMultipleWriteLocations && (this.accountServiceConfiguration.DefaultConsistencyLevel != Documents.ConsistencyLevel.Strong),
true,
enableReplicaValidation: this.isReplicaAddressValidationEnabled,
sessionRetryOptions: this.ConnectionPolicy.SessionRetryOptions);
sessionRetryOptions: this.ConnectionPolicy.SessionRetryOptions,
accountConfigurationProperties: accountConfigurationProperties);

if (subscribeRntbdStatus)
{
Expand Down
22 changes: 22 additions & 0 deletions Microsoft.Azure.Cosmos/src/RMResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Microsoft.Azure.Cosmos/src/RMResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,9 @@
<data name="GlobalStrongWriteBarrierNotMet" xml:space="preserve">
<value>Global Strong write barrier has not been met for the request.</value>
</data>
<data name="NRegionCommitWriteBarrierNotMet" xml:space="preserve">
<value>NRegion Commit write barrier has not been met for the request.</value>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hint about how apps can deal with it? Should they retry? Is it useless?

</data>
<data name="BadClientMongo" xml:space="preserve">
<value>At this time, only write operations made from the MongoDB SDKs are supported. Modifications to MongoDB collections using other SDKs is temporarily blocked.</value>
</data>
Expand Down Expand Up @@ -1307,6 +1310,9 @@ If you would like to serve this query through continuation tokens, then please r
<data name="Server_GlobalStrongWriteBarrierNotMet" xml:space="preserve">
<value>Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Could not achieve backend quorum for Strong or Bounded Staleness after barrier requests.</value>
</data>
<data name="Server_NRegionCommitWriteBarrierNotMet" xml:space="preserve">
<value>Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. N-Region Commit write barrier has not been met for the request.</value>
</data>
<data name="Server_NameCacheIsStaleExceededRetryLimit" xml:space="preserve">
<value>Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Container was re-created, exceeded retries to resolve new identifier. Please contact support with the full exception.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,7 @@ private IDictionary<string, object> QueryStringToDictConverter()
[JsonExtensionData]
internal IDictionary<string, JToken> AdditionalProperties { get; set; }

[JsonProperty(PropertyName = Constants.Properties.EnableNRegionSynchronousCommit, NullValueHandling = NullValueHandling.Ignore)]
internal bool EnableNRegionSynchronousCommit { get; set; }
}
}
Loading