Skip to main content

Module transactions

Module transactions 

Expand description

Transactions with reversible writes and optional durable recovery.

The store’s callbacks run after mutation. A journal of callbacks alone therefore cannot recover a crash between mutation and callback. This layer persists a complete before snapshot at begin and an after snapshot at commit, as well as every callback transition. Recovery restores the last committed snapshot, or the before snapshot of an interrupted transaction.

Snapshots use O(number of links) space per begin/commit and grow the journal; restore uses O(number of links + highest address) store operations, plus sorting and backend index costs. There is no isolation from readers outside the exclusively owned store, no nesting, and no asynchronous commit. Recovery assumes the underlying store remains structurally readable; repairing torn tree-index writes requires support from the storage backend itself.

Put validation/cascade policies around the transaction handle, with a raw store underneath this layer. This records all policy writes and lets recovery restore arbitrary addresses without validation rejecting intermediate states.

Structs§

FileTransitionLog
A versioned, checksummed append-only file journal.
MemoryTransitionLog
An in-memory journal for transactions that do not require crash recovery.
Transaction
An exclusively borrowed transaction; unfinished handles roll back on drop.
TransactionsDecorator
Adds transactions to any raw [Doublets] store.
Transition
A reversible mutation, including both link states.

Enums§

JournalEntry
A durable recovery record.
TransitionKind
The mutation represented by a Transition.

Traits§

TransitionLog
Storage for ordered transaction records.