246 — SnapshotUnavailable

transactionstorage

The read snapshot has expired and is no longer available

What is happening?

SnapshotTooOld is returned when a transaction or snapshot read attempts to access data at a point-in-time that WiredTiger has already purged. WiredTiger maintains a history of document versions for MVCC but regularly evicts old versions under cache pressure. Long-running transactions or reads at very old timestamps can encounter this when the required history is no longer available.

Common causes

  1. Transaction running too long while WiredTiger evicts old history
  2. WiredTiger cache pressure causing aggressive history eviction
  3. Reading with readConcern 'snapshot' at a timestamp older than available history
  4. Secondary read falling behind due to high replication lag

Source code references

ErrorCodes::SnapshotUnavailable found in 15 locations in the MongoDB server source.

Diagnostic Steps

Related Issues