State and recovery
Experimental — breaking changes may land in any release
Pin your version and read the changelog before upgrading.
Pipeline(state_path=...) selects persistence at construction time. The same
durability machinery as the binary — the WAL and the embedded state store —
backs embedded pipelines.
state_path | Mode | Behavior |
|---|---|---|
None (default) | Ephemeral | No state files are created; a crash loses in-flight messages from non-replayable sources. |
"./state.db" | Local durable | The path is created as a state root; a local WAL + embedded state survive process crashes. |
"s3://bucket/prefix" | Object-store WAL | Segments and the manifest persist to S3-compatible storage; survives node loss. |
flow = arkflow.Pipeline(state_path="./state.db") # durable embedded state
flow = arkflow.Pipeline(state_path="s3://bucket/prefix") # S3 WAL
flow = arkflow.Pipeline() # ephemeral (default)
What survives a restart
- Checkpointed sources (e.g. Kafka) resume across restarts: source positions and operator state restore before any input is read.
from_iterpipelines have no offsets to persist — every run replays the container. Persist state only for connector-backed pipelines if you need resume semantics.- Sampling primitives (
take/collect/iter_batches) never rewind; a pipeline run again after sampling continues from persisted state.
Recovery behavior
Recovery is fail-fast, as in the binary: an unreadable or unsupported WAL fails the pipeline at start rather than continuing with possibly lost data. For the WAL mechanics (ack-gated cursors, segment retention, S3 manifest coordination), read WAL durability — embedded pipelines use the same store implementations.
Operations notes
- A local
state_pathdirectory is created atPipeline(...)construction; a path that cannot be created fails immediately withConfigError. - Multiple pipelines can share a machine but should not share one state root.
- Back up the state root (or the S3 prefix) alongside your code; the format version is embedded and older files may be rejected by newer engines.