Expand description
Versioned/MVCC pointers - time-travel addressing for snapshot isolation, immutable trees, and distributed clocks.
Three pointer flavours sharing a common shape (version, target):
| Type | Version | Use case |
|---|---|---|
VersionedPointer<T> | u64 | Local MVCC, snapshot isolation |
HlcVersionedPointer<T> | (u64 physical, u64 logical) | Distributed (CockroachDB-style HLC) |
VectorClockPointer<T, N> | [u64; N] per-node | Per-node causal ordering (Riak-style) |
Plus a VersionedChain<T> linked-list of VersionedNode<T>s
that retains all historical versions for time-travel queries.
§The K_temporal / K_cascade interplay
VersionedPointer<T> is a single-version snapshot.
VersionedPointer<VersionedPointer<T>> is the K_cascade = 2 case:
outer carries coarse (physical) time, inner carries fine (logical)
counter. This is exactly the Hybrid Logical Clock pattern that
CockroachDB and Spanner use - here exposed as a first-class
typed primitive via HlcVersionedPointer<T>.
Structs§
- HlcVersioned
Pointer - Pointer + HLC. Composes
VersionedPointerwith the cascade structure of(physical, logical). Two-level rejection onvisible_at: physical mismatch rejects fast, logical compares only when physical ties. - Hybrid
Logical Clock - Hybrid Logical Clock: (physical timestamp, logical counter) pair. Combines wall-clock time (microsecond resolution typical) with a per-node monotonic counter that breaks ties between events recorded in the same physical instant.
- Vector
Clock - Per-node monotonic counters.
Nis the number of nodes in the system;clock[i]is nodei’s observed event count. Causal ordering:acausally precedesbwhen every component ofais <= the corresponding component ofb, with at least one strict less-than. - Vector
Clock Pointer - Pointer + vector clock. Useful for distributed CRDT-style snapshot reads where causal-but-concurrent updates must be surfaced rather than ordered.
- Versioned
Chain - Linked list of
(version, value)nodes ordered newest-first. Time-travel reads walk the chain until they find a version <= the query snapshot. - Versioned
Pointer - Pointer + monotonic u64 version. Used for snapshot-isolation
reads: visible at a query snapshot when
self.version <= snapshot.