Backfills & Reprocessing

Fixing history without breaking the present. Backfill ranges, late-arriving data, deduplication, merges, replay and the validation that has to happen before you publish.

Backfills

Recomputing history after the logic or the inputs changed — and why the hard part is publishing the result, not computing it.

Q · The revenue model has been miscounting refunds for six months. The fix is merged and today is correct. What does it take to make those six months right?
What Backfills Break

Duplicated periods, overwritten current data, a saturated warehouse and a source knocked over by its own history — the four ways a correction becomes an incident.

Q · A backfill re-ran a range that was already populated. Every task succeeded. What is now wrong, and which check would have said so?
Planning a Backfill
▶ lab

Five questions to answer before the first partition runs: which range, is the re-run safe, where does the compute go, how do we validate, and how do we publish.

Q · Before a single historical partition is recomputed, what has to be decided — and which of those decisions is irreversible once the run starts?
Validating a Backfill Before You Publish

Reconcile the range against the source, explain every old-versus-new difference, and prove a period the bug never touched is unchanged — the check people skip.

Q · The recomputed range is sitting in staging. What has to be true before it is allowed to replace what consumers are reading?
Reprocessing vs Retrying

The same button means two different things: finishing work that never completed, and redoing work that completed and is now wrong.

Q · A task in yesterday's DAG is red and a task in March's DAG is green but wrong. Both are cleared and re-run with the same command. Why is only one of them safe?
Late-Arriving Data

An event that happened on Tuesday and arrived on Thursday, after Tuesday was already computed, published and read.

Q · A record belonging to a partition you closed three days ago has just landed. Where does it go, and who has to be told that Tuesday changed?
Deduplication

Which key you deduplicate on decides which duplicates you can see — and a producer retry with a fresh id is invisible to every id-based scheme.

Q · The same order appears twice in the fact table. Which of the two copies is wrong, and which key would have told you they were the same thing?
Upserts and Merges

Replacing rows by key instead of appending them — the write that makes re-running safe, and the assumptions it quietly depends on.

Q · What has to be true for running the same load twice to leave the table in exactly the state one run would have produced?
Full Refresh vs Incremental

Rebuild everything every time, or process only what changed. The first is expensive and has no state to get wrong, and it is the right answer more often than people admit.

Q · Should this model recompute all of history on every run, or only the rows that changed — and what does the second one oblige you to track forever?
Replay from the Log

Re-reading a retained event log versus recomputing from the raw layer — two recovery paths with different windows, different guarantees, and retention as the hard boundary on both.

Q · A consumer has been broken for three days. Do you replay the log, rebuild from raw, or re-snapshot the source — and which of those is still available?