# MongoServerError: Queryable backup mode failed to create consistent snapshot: operationTime too far behind

- **ID:** `mongodb/queryable-backup-mode-failed`
- **Domain:** mongodb
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| mongodb 6.0 | active | — | — |
| mongodb 7.0 | active | — | — |

## Workarounds

1. **Increase oplog size on all replica set members: `db.adminCommand({ replSetResizeOplog: 1, size: 20480 })` (20GB) to retain more history for queryable backup.** (85% success)
   ```
   Increase oplog size on all replica set members: `db.adminCommand({ replSetResizeOplog: 1, size: 20480 })` (20GB) to retain more history for queryable backup.
   ```
2. **Reduce write load on the primary during backup windows by throttling application writes or scheduling backups during off-peak hours.** (70% success)
   ```
   Reduce write load on the primary during backup windows by throttling application writes or scheduling backups during off-peak hours.
   ```
3. **Use `db.adminCommand({ setParameter: 1, queryableBackupModeSeconds: 600 })` to increase the allowed backup window from default 300 seconds to 600 seconds.** (78% success)
   ```
   Use `db.adminCommand({ setParameter: 1, queryableBackupModeSeconds: 600 })` to increase the allowed backup window from default 300 seconds to 600 seconds.
   ```

## Dead Ends

- **** — Restarting clears the oplog cache but does not increase the oplog size or speed up catching up to the primary; lag may resume immediately. (85% fail)
- **** — Lowering write concern does not affect the total write load; it only changes acknowledgment behavior, potentially causing data loss in failover. (75% fail)
- **** — operationTime is a server-side logical clock; manual changes are rejected and can cause snapshot inconsistency. (95% fail)
