Environment
- YugabyteDB - 2.16.0 and above
Issue
YSQL query fails with below exception:
server error (FATAL: Snapshot too old: Snapshot too old. Read point: { physical: 1675135160 }, earliest read time allowed: { physical: 1674530417 }, delta (usec): 1198293804101: kSnapshotTooOld (SQLSTATE 72000))
Resolution
Overview
The above error in YugabyteDB occurs when the database encounters a transaction that needs to access a data that has been modified too early for the transaction's snapshot. If a transaction takes a long time to complete, it may read data that has been updated by another transaction, causing the "snapshot too old" error. One other possible scenario where this issue could happen is a corner case bug as described in the Github Issue - GHI-15761. The default value of `ysql_enable_read_request_caching` is false. However if the configuration is turned on, the above mentioned scenario may happen.
Solution
To resolve the issue, turn off the configuration flag `ysql_enable_read_request_caching` as mentioned in the documentation.
Comments
0 comments
Please sign in to leave a comment.