question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The client does not attempt to read from other regions

See original GitHub issue

Describe the bug The client does not attempt to read from another region.

To Reproduce The issue is intermittent, it manifests when the primary (write) region is unavailable.

Expected behavior The client automatically tries reading from another available region.

Actual behavior We use GetItemLinqQueryable. The client is configured as follows:

var clientBuilder = new CosmosClientBuilder($"AccountEndpoint={host};AccountKey={accountKey}")
    .WithSerializerOptions(new CosmosSerializationOptions { PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase })
    .WithThrottlingRetryOptions(maxRetryWaitTimeOnThrottledRequests.ToTimeSpan(), maxRetryAttemptsOnThrottledRequests);

return clientBuilder.Build();

We originally had just one region in West Europe and couple of days ago added a read-only region in North Europe. We did not change the client configuration in any way.

The problem is that we still occasionally get these errors when querying items:

Response status code does not indicate success: ServiceUnavailable (503); Substatus: 0; ActivityId: 61ec3016-6990-4816-87f7-19d08d5b3e2f; Reason: (The request failed because the client was unable to establish connections to 3 endpoints across 1 regions. The client CPU was overloaded during the attempted request.)

Why doesn’t it attempt to reach the second region? Or am I misreading the error message?

Environment summary SDK Version: 3.9.11 OS Version: Windows App Service in Azure

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skurikcommented, Oct 6, 2020

Great, I was wondering if ApplicationRegion reduces to PreferredRegions behind the scenes. Thanks @ealsur!

0reactions
msftbot[bot]commented, Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to connect to Azure Cosmos Db Account using ...
I was facing same issue. What worked for me is changing ConnectionMode to ConnectionMode.Gateway while initializing CosmosClient like :
Read more >
Diagnose and troubleshoot the availability of Azure ...
If the regional preference configuration contains regions that aren't an available region in the account, the values will be ignored. If these ...
Read more >
How multiple writes and reads are handled in Azure ...
This article presents how to enable geo-replication and multiple writes regions in the Azure Cosmos DB.
Read more >
Multi-Region fundamental 2: Understanding the data
Managing data is a non-trivial problem with multi-Region architectures. The geographical distance between Regions imposes an unavoidable latency, ...
Read more >
Regional and multi-region configurations | Cloud Spanner
Read -only regions contain read-only replicas, which can serve low-latency reads to clients that are outside of the read-write regions. Read-only replicas ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found