Skip to main content

Module engine

Module engine 

Source
Expand description

Optional staged links engine: concurrency, immutable history, and a replaceable commit log. See docs/ENGINE-STRATEGIES.md for costs and limits.

Unlike the legacy undo decorator, no underlying mapped data is modified while a transaction is open. A checksummed logical revision is flushed before it becomes visible. The log is the authoritative storage.

Modules§

cluster
Optional optimistic coordination across namespaced shards. A coordinator must provide atomic snapshots/CAS; local workspaces are never shared state.
maintenance
Optional bounded namespace maintenance; ordinary atomic stores need not implement it.
paged
Optional SQL-free shadow pages for the ordered log, independent of logical revision and replication strategies. See docs/protocol/native-pages.md.
partitioned
Immutable journal objects on independent data stores; only small pointers participate in the catalog’s atomic transaction. Never mutate/delete objects.
raft
A draft Raft replica that keeps the journals of an AtomicJournalStore.
reclaiming
Explicit epoch-fenced reclamation for separately owned immutable namespaces.
recovery
Check and repair a damaged engine journal. Engine::open refuses a journal with any bad record; these functions apply the same rules to report the longest prefix that still replays, and to rebuild a journal from it or from an intact copy. See docs/ENGINE-RECOVERY.md for what each step can and cannot get back.
replication
Fixed-primary log synchronization. Replica acknowledgements are copies, not consensus: no elections, automatic failover, or cross-shard atomicity.

Structs§

BackgroundCompaction
Calls compact_journal_after every period on its own thread. Each pass that compacts holds the commit lock while the journal is replaced, so commits wait for it. The first failure ends the worker and stop returns it; a failed replacement also fences the engine until reopen, as with a manual compaction. Dropping the handle stops the worker and discards any failure.
Branch
DeltaLog
Single-span delta encoding with at most interval-1 consecutive deltas. Compress complete snapshots; logical change records pass through unchanged. Inner resources/fencing remain caller-owned. Mutation errors require reopen.
Engine
Share clones of this handle across threads. All writes must use its sessions; opening multiple independent writers on the same log is not supported.
EngineOptions
EngineTransaction
An isolated write set with the same raw LinksStorage API as other backends. Dropping or rolling back discards the write set; allocation may leave gaps.
MemoryLog
Row
Savepoint
Names one position in the write set of the session that created it.
Snapshot
Immutable revision, safe to keep after history retention or transaction end.
TimedLog
Keeps revision|unix milliseconds in a second log for every record appended to inner. Records and their format are unchanged, so an engine or a backup never needs to know this decorator exists, and the cost is one more append and flush.

Enums§

ConcurrencyControl
Constraint
ConstraintValidation
Constraint maintenance, independent of concurrency and serializable reads.
GroupCommitOutcome
One independent session’s result, in the caller’s input order.
HistoryPolicy
IsolationLevel
RevisionEncoding
Logical journal payload, independent of the physical log’s encoding.
SerializableValidation
StateStructure
In-memory revision representation, independent of durability and isolation.

Functions§

restore_backup
Copy an archived journal to an empty log, stopping at one revision, and return the revision the copy ends at. None copies the whole archive. Opening the destination gives the engine as it was at that revision, on a new timeline.
revision_at
The latest revision written by time, for restore_backup. Refuses a time before the first timestamp, because the state then is not known.