You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cosmos DB未指定首选位置及多区域故障时的读写行为问询

Cosmos DB .NET SDK Behavior in Regional Failures (Manual Failover Disabled)

Let’s break down the two scenarios you’re asking about, since you’ve got automatic failover disabled—meaning the write region stays fixed as A unless you manually trigger a failover:

Scenario 1: ConnectionPolicy.EnableEndpointDiscovery = true but no PreferredLocations configured

When region A (your designated write region) goes down:

  • Write operations: These will fail. With automatic failoff disabled, Cosmos DB won’t automatically switch the write region to another location. The SDK can only route writes to the official write region, so there’s no valid target for write traffic here.
  • Read operations: The SDK will automatically discover the remaining healthy regions (B and C) and route read traffic to them. Since endpoint discovery is enabled, it fetches the latest list of available regions from the Cosmos DB service and uses the next available location for reads, even without preferred locations specified.

Scenario 2: ConnectionPolicy.PreferredLocations = {A, B} and both A & B fail

Again, automatic failover is off, so the write region remains locked to A:

  • Write operations: These will fail. Even with both A and B unavailable, the service won’t automatically promote another region to be the write target. There’s no way to route writes until you manually trigger a failover to a healthy region.
  • Read operations: The SDK will first attempt to use your preferred locations in order (A first, then B). When both are unresponsive, it falls back to the remaining healthy region (C) thanks to endpoint discovery being enabled. It will route all read traffic to C as long as it stays available.

Quick reminder: If region A stays down long-term, you’ll need to manually initiate a failover via the Azure portal or API to make another region the new write target.

内容的提问来源于stack exchange,提问作者Ulf Åkerstedt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:08:20