# MongoServerError: 均衡器轮次迁移失败：命名空间 mydb.mycoll 的块迁移失败

- **ID:** `mongodb/balancer-round-migration-failure`
- **领域:** mongodb
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

由于临时网络问题或源/目标分片上的冲突操作，均衡器无法迁移块。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| MongoDB 7.0 | active | — | — |
| MongoDB 6.0 | active | — | — |
| MongoDB 8.0 (early access) | active | — | — |

## 解决方案

1. ```
   Check balancer state and retry migration after resolving any conflicting operations (e.g., long-running queries or index builds). Use sh.status() to monitor balancer activity.
   ```
2. ```
   Increase balancer window or reduce chunk size to make migrations more manageable: use sh.setBalancerState(true) and adjust chunk size via sh._setBalancerChunkSize(64) (in MB).
   ```
3. ```
   Force chunk migration manually using moveChunk with a specific shard key range and wait for completion: sh.moveChunk('mydb.mycoll', { shardKey: value }, 'targetShard').
   ```

## 无效尝试

- **** — moveChunk may fail with same error if underlying issue persists, and can disrupt ongoing migrations. (60% 失败率)
- **** — Stopping balancer is a temporary pause, not a fix; the root cause (e.g., network blip) remains. (70% 失败率)
- **** — Restart often doesn't resolve underlying connectivity or operation conflicts. (50% 失败率)
