Open camillemarie opened 1 year ago
@camillemarie it's an interesting scenario where compute and storage are in different environments.
Our current PreferredRegions population assumes that compute also will be in the same environment and for all other environments-regions it assumes equidistant.
@camillemarie Based on https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.applicationregion?view=azure-dotnet#remarks this list is then intersected with the account regions.
Which is the impact or problem you are facing with this configuration? Which is the region you'd expect your request to go to?
@ealsur The impact is that request latency is higher than expected because requests go from our app in East US 2 EUAP => West US 2 replica, when they could go to the East US 2 replica instead. We've worked around this by hardcoding the ApplicationRegion in East US 2 EUAP to East US 2 for now.
Canary doesn't have the same reliability guarantees as the other public Azure regions, but I wouldn't consider it a fully different environment in the same way that Fairfax or Mooncake are different environments. I can see the argument to prefer Canary regions for Canary apps, but the Public regions should be in order instead of considered equidistant. i.e. East US 2 EUAP => [East US 2 EUAP, Central US 2 EUAP, East US SLV, East US 2, East US, etc]
Describe the bug
When I set ApplicationRegion to East US 2 EUAP, the first 3 PreferredLocations generated by the SDK are other Canary regions, but then the rest of the list is in a seemingly random order. Is there a reason for this?
To Reproduce
Expected behavior The SDK-generated PreferredLocations would list regions in order of expected network latency from the ApplicationRegion.
Actual behavior
Environment summary SDK Version: 2.18.0. Will try to repro on 3.31.0 shortly. Cosmos DB account regions: [ "East US 2", "Central US", "West Europe", "Southeast Asia", "Brazil South", "Australia East", "Japan East", "West US 2", "North Europe", "West US", "East US", "North Central US", "South Africa North", "Central India", "UAE North", "Germany West Central", "East Asia", "South Central US", "Sweden Central", "UK South" ]