hello, I use mongo-go-driver to connect mongo,an error was encountered while reading in a transaction.
error message:
(SnapshotUnavailable) Unable to read from a snapshot due to pending collection catalog changes; please retry the operation. Snapshot timestamp is Timestamp(1660749105, 13). Collection minimum is Timestamp(1660749106, 16)
Searching for that error message, I found a seemingly relevant ticket SERVER-41532, which suggests that the error can happen when trying to read data in a transaction with read concern “Snapshot” from a MongoDB sharded cluster.
A few questions to help me understand your use case better:
Is your MongoDB deployment a sharded cluster? If not, what is the topology (e.g. standalone, replica set, sharded cluster)?
When the error happened, did you recently make changes to any databases or collections (e.g. added, removed, renamed)?
Can you reproduce the error reliably or only intermittently? If you can reproduce the error reliably, what are the steps needed to reproduce the error?
Unfortunately the above ticket has no resolution, so it’s not clear if updating to a newer server version would resolve the problem. The fix suggested in the ticket is to retry the transaction, which will likely resolve the issue.