# MongoServerError: OplogSlotNotAvailable: 由于复制延迟无法分配oplog条目

- **ID:** `mongodb/oplog-slot-not-available`
- **领域:** mongodb
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

从节点复制延迟导致主节点oplog槽位耗尽，无法处理新写入请求。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| MongoDB 6.0.5 | active | — | — |
| MongoDB 7.0.1 | active | — | — |

## 解决方案

1. ```
   Temporarily reduce write load by throttling application writes or pausing batch jobs. Use db.setProfilingLevel(0) to disable profiling if enabled.
   ```
2. ```
   Increase secondary's priority or add more secondaries to distribute replication load. Use rs.add('host:port') to add a new secondary.
   ```

## 无效尝试

- **** — Increasing oplog size doesn't fix the underlying replication delay; it only delays exhaustion. (60% 失败率)
- **** — Restarting the primary resets the oplog but doesn't resolve secondary lag; issue recurs quickly. (80% 失败率)
