Skip to main content

Module primary

Module primary 

Source
Expand description

Primary-side replication: WAL record production and snapshot serving.

The logical WAL spool byte format is a reddb-file contract. This module owns runtime policy: appending after writes, syncing acknowledged records, serving replica pulls, and pruning once slots make records removable.

Structs§

LogicalWalSpool
Durable append-only logical WAL spool kept beside the main .rdb file.
PrimaryReplication
Primary replication manager.
ReplicaState
State of a connected replica. PLAN.md Phase 11.4 fields: last_seen_at_unix_ms updates on every interaction (pull or ack); last_sent_lsn updates when the primary serves a pull_wal_records batch; last_durable_lsn updates when the replica reports its WAL is durably written via ack_replica_lsn.
ReplicationProgress
Primary-side replication progress derived from the replica registry.
WalBuffer
In-memory WAL buffer for replication. Primary appends records here; replicas consume from it.

Enums§

ResumeMode
How a replica’s pull should be served, decided from its slot state.