Root cause
The MongoDB resume token stored in the connector's offset refers to a position that has rolled off the oplog. The oplog is a capped collection — old entries are removed as new ones arrive. If the connector is stopped for longer than the oplog window (typically 24–72h on Atlas), the token becomes invalid.
How to fix
- Increase oplog size — mongod.conf: storage.oplogSizeMB: 51200 (50 GB). Minimum: accommodate your peak write rate × 2 hours of headroom.
- Enable heartbeat.interval.ms in Debezium to keep the resume token fresh even during low-activity periods.
- To recover: delete the connector, clear its offset from the Kafka Connect offsets topic, and recreate it (full re-snapshot).
- On MongoDB Atlas: increase oplog retention in the cluster configuration.
Official Debezium documentation ↗