Change Data Capture Pipeline · View 14 of 21 · Runtime
The mechanism
- Record the log position first, stream into the log from that position, then snapshot in primary-key chunks and replay the overlap on top (ADR-05).
- Correctness rests on one property: the apply path keeps the higher log position per key. Snapshot rows carry op = READ and the lowest precedence.
- Snapshot and stream are the same event type on the same apply path, so backfill cannot diverge from live capture.
Alternatives rejected
- Lock the table and take one consistent position — correct, and unacceptable on a live primary.
- Snapshot a point-in-time clone — clean seam, but it ties the design to the engine's cloning and pays for a clone per table (see ADR-05 options).
Failure handling
- An interrupted snapshot resumes at the last completed chunk; it never restarts.
- If the source log is truncated while a snapshot runs, the table is marked for re-snapshot and fails loudly — never resumed with a gap (ADR-03).