Checkpoints and Offsets
Three mechanisms track "where a pipeline left off", and they follow one rule: everything commits only after a fully successful run. A failed or killed run leaves the pipeline exactly where it was.
At a glance
- One commit rule - offsets and step state advance only after the entire run succeeds.
- Offsets - incremental batch watermarks, one row per source asset.
- Checkpoints - streaming position and state, one per destination output.
- Step state - Parquet state files for stateful batch transforms.
| Mechanism | Used by | Stored where |
|---|---|---|
Asset offset | incremental batch sources | pipeline_source_offsets table |
| Spark checkpoints | streaming pipelines | checkpoints dir / object prefix |
| Step state | stateful batch transforms | Parquet state files per step |
Asset offsets
Offsets make batch reads incremental. Declare one on an asset; each run reads only rows past the stored watermark and stores the new high-water mark:
Code
Fields: key (the column, or file_modified / file_name for files), initial_value (the starting watermark), and type (see Sources for the accepted values; internally each normalizes to TIMESTAMP, INTEGER, STRING, or CURSOR). APIs also take an optional response_key + format (iso8601, epoch_millis, epoch_seconds, or a pattern).
How each family applies the watermark is covered in Sources - JDBC pushes it into SQL, NoSQL filters after the read, files use modification times or names, and APIs send it as request parameters.
Commit semantics
The offset lifecycle per run:
- Load - current offsets are read before sources
- Update in memory - each read produces a new high-water mark
- Commit once - after the entire run succeeds, all offsets are written in one go
If any stage fails, the run is killed, or the run is a no-op (an asset read 0 rows with no declared schema:) - nothing commits. The next run re-reads from the previous watermark. Rows may be processed twice on failure (at-least-once), but they are never skipped.
Where they live
One row per (pipeline, source, asset) in the pipeline_source_offsets table - offset_key, offset_key_type, offset_value, updated_at. Inspect them directly in PostgreSQL:
Code
Spark checkpoints
Streaming pipelines don't use the offsets table - their position and state live in Spark structured streaming checkpoints, one query per destination output:
| Setting | Location |
|---|---|
| Default | {checkpoints_dir}/{pipeline}_{dest}_{output}_chk |
| Custom | output option checkpoint_location |
| Object backend | s3a://{bucket}/{base_prefix}/checkpoints/… |
Checkpoints carry everything a streaming query needs to resume: consumed source positions, stateful transform state, and sink state. Kill the run, start it again, and it resumes from the checkpoint - nothing is reprocessed and nothing is lost.
Delivery semantics depend on the sink:
| Sink | Semantics |
|---|---|
| Idempotent sinks (e.g. JDBC upsert by keys) | effectively exactly-once |
| Other sinks | at-least-once per micro-batch |
Stream sources never declare asset offset or chain - the checkpoint is the single source of truth for their position.
Step state
The stateful transforms - aggregate, forward_fill, gap_fill with state.enabled: true - keep cross-run state so results accumulate over runs instead of restarting:
| Mode | State storage |
|---|---|
| batch | Parquet state file per step, under the pipeline-state dir |
| stream | Spark checkpointed state (with the query checkpoints) |
Batch state is written atomically (staged, then swapped - with a backup kept for rollback) only after all destinations succeed. On failure it is discarded entirely: a run that dies mid-way leaves state exactly as the last successful run left it, and the next run picks up from there.
Code
What happens when a run dies
| Event | Offsets | Step state | Checkpoints |
|---|---|---|---|
| Run succeeds | committed | committed | advanced |
| Run fails | unchanged | discarded | (stream) unchanged |
| Run killed | unchanged | discarded | (stream) unchanged |
| No-op run | unchanged | - | - |
Backfilling a missed range
There is no automatic backfill: a schedule that came due while the platform was down fires once and advances, and offsets only move forward. Editing an asset's offset.initial_value does not rewind an established pipeline either - the committed watermark takes precedence over the starting value in the spec.
To reprocess a time range, run a separate, unscheduled pipeline bounded by an explicit query:
backfill_orders.yaml
No offset is declared - the query bounds the range. Keep the backfill pipeline's schedule disabled, write with upsert (or overwrite) so re-read rows do not duplicate, and work in bounded ranges so each run is easy to monitor and retry.
Related pages
- Execution Lifecycle - statuses, failure, and kill behavior
- Batch vs Stream - which mechanism applies to your pipeline
- Sources - declaring offsets per source family
- Transforms - stateful steps and their options
- Destinations -
checkpoint_locationper output