276 — IndexBuildAborted

queryreplication

The change stream resume token is no longer available in the oplog

What is happening?

ChangeStreamHistoryLost is returned when a change stream attempts to resume from a token that references an oplog entry that has already been overwritten. The oplog is a capped collection with limited size; once it wraps around, old entries are lost. If a change stream consumer falls behind or pauses for too long, its resume token becomes invalid.

Common causes

  1. Change stream consumer was stopped or paused for too long
  2. Oplog size is too small for the write throughput
  3. Consumer processing is too slow to keep up with the change rate
  4. Application restarted with a stale resume token from persistent storage

Diagnostic Steps