Expand description
Change Data Capture (CDC) — stream of database change events.
Exposes entity mutations (insert, update, delete) as a pollable event stream. Consumers poll with a cursor (LSN) to receive new events since their last position.
Structs§
- CdcBuffer
- CDC event buffer — circular buffer of change events.
- CdcStats
- CDC buffer statistics.
- Change
Event - A single change event.
- Change
Record - KvWatch
Event - A committed single-key KV change surfaced by WATCH.
- Range
Authority - Issue #991 — the range-authority watermark a replica or recovery target holds for a single range: the minimum term and ownership epoch it will accept for that range’s user-data changes.
- Range
Catchup Plan - The result of filtering a slice of the shared logical stream down to one
range’s catch-up work.
applyholds indices into the input slice in ascending LSN order;resumeis the position advanced past every applied record (persist it to make catch-up resumable);rejectedlists the fenced records. - Range
Progress Tracker - Tracks streaming progress for many ranges over the one physical WAL. A data
member feeds every derived record through
index_recordto maintain each range’s primary frontier without splitting the log, and notes shipped/applied LSNs per range. Every range advances independently, so one lagging range does not skew another’s lag or failover eligibility. - Range
Stream Position - The per-range resume position and authority watermark a range follower
persists. A range replica restarting catch-up hands the primary this
position so streaming resumes from
applied_lsnfor the range instead of replaying the whole shared WAL, and so the follower keeps fencing records from a deposed owner. - Range
Stream Progress - Independent streaming progress for one range over the shared physical WAL.
- Range
Stream Reject - A record that range catch-up refused, with the reason. Surfaced (rather than silently dropped) so the caller can count fenced records and tell a stale owner apart from a quiet range.
Enums§
- Change
Operation - Range
Admit Error - Why a
RangeAuthorityrejected a record (issue #991). - Range
Stream Decision - Why a single record was routed the way it was during range catch-up.
Functions§
- change_
record_ from_ entity - classify_
range_ record - Route a single record relative to a range’s resume position. Routing order: other-range first (cheapest, most common), then already-applied, then the authority fence — so a record we have already applied is skipped without being treated as a fence violation, while a fresh stale-owner write is rejected.
- plan_
range_ catchup - Filter a slice of the shared logical stream (ascending by LSN) into the
catch-up plan for a single range, resuming from
position. Only records stamped forposition.range_id, past its resume LSN, and clearing its authority fence are selected; the returnedresumeposition has been advanced past them so a follower can persist it and continue. - public_
item_ kind - server_
json_ to_ wire_ json - wire_
json_ to_ server_ json