mongodb
runtime_error
ai_generated
partial
MongoServerError:可查询备份模式无法创建一致性快照:操作时间落后太多
MongoServerError: Queryable backup mode failed to create consistent snapshot: operationTime too far behind
ID: mongodb/queryable-backup-mode-failed
80%修复率
88%置信度
1证据数
2024-08-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| mongodb 6.0 | active | — | — | — |
| mongodb 7.0 | active | — | — | — |
根因分析
由于高写入量或复制缓慢,从节点的oplog窗口不足以提供可查询备份模式所需的一致性快照。
English
The secondary node's oplog window is insufficient to provide a consistent snapshot for queryable backup mode due to high write volume or slow replication.
官方文档
https://www.mongodb.com/docs/manual/tutorial/queryable-backup/解决方案
-
Increase oplog size on all replica set members: `db.adminCommand({ replSetResizeOplog: 1, size: 20480 })` (20GB) to retain more history for queryable backup. -
Reduce write load on the primary during backup windows by throttling application writes or scheduling backups during off-peak hours.
-
Use `db.adminCommand({ setParameter: 1, queryableBackupModeSeconds: 600 })` to increase the allowed backup window from default 300 seconds to 600 seconds.
无效尝试
常见但无效的做法:
-
85% 失败
Restarting clears the oplog cache but does not increase the oplog size or speed up catching up to the primary; lag may resume immediately.
-
75% 失败
Lowering write concern does not affect the total write load; it only changes acknowledgment behavior, potentially causing data loss in failover.
-
95% 失败
operationTime is a server-side logical clock; manual changes are rejected and can cause snapshot inconsistency.