Expand description
Lock-free MVCC epoch readers.
Each reader snapshots the db state at a fold point (every FOLD_EVERY_K
commits) plus a bounded delta tail, allowing concurrent reads without holding
the write lock.
§Correctness guarantees
- Snapshot isolation: query returns results consistent with the db state
at the moment [
GraphDb::reader] was called. - RBAC mask coherence (constraint 2):
ReaderSnapshot::mask_for_roleandReaderSnapshot::query_maskedoperate on the same frozen base, so no node can slip through a stale mask. - Delta chain bounded: at most
FOLD_EVERY_K − 1deltas in the tail (fold resets the counter synchronously on the write path).
Structs§
- Commit
Delta - Per-commit overlay change record. Immutable after creation.
- Frozen
Overlay - Full clone of overlay state captured at fold time.
- Reader
Snapshot - Lock-free reader snapshot: frozen overlay + optional V8 base + pending delta tail.
Constants§
- FOLD_
EVERY_ K - Fold trigger: every K commits, the overlay is cloned into a new
FrozenOverlayanddelta_tailis reset. The tail length is always ≤ K−1.