Expand description
MvccClock — the logical-clock primitive that hands out
begin- and commit-timestamps for MVCC transactions (Phase 11.2).
Per docs/concurrent-writes-plan.md:
A monotonic
u64counter, per-Database. Hands outbegin_tsatBEGIN CONCURRENTandcommit_tsat the start of validation. Wrapped inAtomicU64; no contention because each transaction calls it twice.
The clock is persisted to the WAL header on each checkpoint so
reopens resume past the highest committed timestamp — see
crate::sql::pager::wal::WalHeader::clock_high_water. Without
persistence, two transactions on either side of a reopen could
receive the same timestamp and the snapshot-isolation visibility
rule (begin <= ts < end) would mis-classify one of them.