246 SnapshotUnavailable: SnapshotUnavailable
MongoDBWhat does it mean?
A read with the requested snapshot read concern (readConcern: snapshot) could not be performed because the server cannot provide a consistent snapshot for that point in time. It is usually related to a read timestamp that has not advanced far enough or has fallen behind.
Why does it happen?
readConcern 'snapshot' is used (mostly in multi-document transactions) but a consistent view for the requested atLeast/at timestamp is not yet available; e.g. a newly created collection/index, a catalog change, or replication lag. The server rejects the read in this case.
How to fix it
This is usually transient; retry the operation after a short delay (the driver's transient transaction error retry mechanism covers this). If you recently ran DDL (collection/index creation), start the transaction after it. Check replication lag and node health. If a snapshot read is not truly needed, choose a more suitable readConcern.
More from this engine
- 28 PathNotViableCannot use the part of the path to traverse the element
- 216 ElectionInProgressElectionInProgress
- 225 TransactionTooOldTransactionTooOld
- 257 TransactionTooLargeTransactionTooLarge
- 276 IndexBuildAbortedIndexBuildAborted
- 86 IndexKeySpecsConflictIndexKeySpecsConflict
- 166 CommandNotSupportedOnViewCommandNotSupportedOnView