Updated on 2025-12-09 GMT+08:00

RCR Uheap Visibility Mechanism

Ustore visibility is determined by building consistent versions of data rows. Old snapshots can be obtained from undo records. For example:

The figure below illustrates three scenarios of MVCC snapshot visibility checks. A reader thread with a snapshot CSN of 300 determines which version of a row is visible:

  1. The TD slot pointed to by the row records a transaction (XID) that is already committed, with a TD CSN less than the snapshot's CSN. This means the TD XID is visible to the snapshot. Furthermore, the transaction XID that generated the current page version of this row must be older than the TD XID and is also committed. Consequently, the latest page version is the visible version for the snapshot.
  2. The TD slot records a committed transaction XID, but its TD CSN is greater than the snapshot's CSN, making it invisible. Therefore, the system must traverse the undo chain from newest to oldest to locate a visible version (that is, a version generated by a committed transaction with a CSN less than 300). It ultimately finds the version with a CSN of 200.
  3. The transaction that reuses the TD slot is still in progress, making its TD XID invisible to the snapshot. Again, the system traverses the undo chain from newest to oldest to find a visible version. The traversal concludes without finding a corresponding undo record, indicating that even the undo log generated by the transaction that created the current page version has been purged. This implies that all historical versions of this tuple have become visible to all possible snapshots. Therefore, the latest page version is the visible version.