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§

address_allocator
Selected permanent ranges over one linearizable atomic journal key. A grant is never recycled; author lineage fencing remains caller-owned.
author_fence
Explicit author takeover. Every guarded data CAS includes the fence key.
causal
Selected causal semantics. No I/O, owner fencing or replication.
causal_batch
Selected bounded local batches; remote leaves do not retain group atomicity.
causal_merkle
Selected bounded content snapshots and proof-checked causal transfer.
causal_named
Checked named/query facade over the sealed u64 workspace. The wider query marker can never equal a stored identity or reference.
causal_projection
Selected owned projection. Visibility never discards causal evidence.
causal_replica
Selected bounded local causal ownership; no global atomicity claim.
causal_session
Ordinary owned links/names staging with explicit-token local publication.
cluster
Optional optimistic coordination across namespaced shards. A coordinator must provide atomic snapshots/CAS; local workspaces are never shared state.
etcd
HTTP(S) etcd JSON gateway adapter. Requires a trusted durable etcd deployment. One atomic Txn reads all selected keys; writes compare modification revisions.
lsm
Selected physical LSM components. WAL semantics perform no storage I/O; replay alone does not validate the physical tables selected by a manifest.
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.
sqlite
Optional SQLite page-WAL component at the ordered revision-log boundary. A dedicated connection belongs to this log. Drop rolls pending records back. SQLite writer locking does not coordinate independent cached engine states; stale-tail/component errors fence this owner until it is dropped and reopened.

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.