Expand description
CDC feed layer over crate::source::ReplicationSource —
the (generation, offset) cursor semantics the public FEED.* /
changes_since surfaces speak.
Cursor contract:
generationidentifies one unbroken offset history. A given(gen, offset)pair refers to the same stream prefix forever. The value is an OPAQUE random identity, not a counter: two nodes counting in lockstep (a startup election on one, a failover promotion on the other) land on the same number for different histories, and a stale cursor then slips through the fence into offset aliasing (the availgate failover wedge). Randomness is what makes cross-node fencing sound; there is no ordering.- Clean shutdown + restart preserves both (continuity); FLUSHALL,
restore-from-snapshot, or an unclean shutdown draws a fresh
genand resetsoffsetto 0. - A cursor from any OTHER generation, or one whose offsets were
evicted, answers
FeedRead::Resynccarrying the current tail — the consumer rebuilds (SCAN) and resumes from there.
Structs§
- Feed
Frame - One decoded feed entry: the offset plus the frame’s wire bytes
(envelope + offset + RESP argv — same encoding replicas consume;
[
crate::replica_decode] parses it). - Feed
Source - Generation-aware wrapper: owns the generation number alongside the
backlog. The runtime persists
generationviakevy-persist’s feed sidecars; this type only holds the in-memory value.
Enums§
- Feed
Read - Why a feed read could not be served from the backlog.