Skip to content

Add support for starting/restarting without state in leader mode - #1122

Merged
mwylde merged 2 commits into
masterfrom
fix_restart_state
Aug 3, 2026
Merged

Add support for starting/restarting without state in leader mode#1122
mwylde merged 2 commits into
masterfrom
fix_restart_state

Conversation

@mwylde

@mwylde mwylde commented Aug 1, 2026

Copy link
Copy Markdown
Member

This is the second attempt at #1111, which accidentally merged the wrong version of this code. This PR reverts that change, and adds the intended version.

The existing implementation of skipping state for controller mode relies on querying the most recent epoch for the job from the checkpoints table, and then setting that as the "ignore_before_epoch" field in the config. This approach is awkward for leader mode though, as we don't have a checkpoints table, and determining the latest epoch involves going to object storage.

There are several principled approaches we could take here—for example, introducing a "state version" field, which could be bumped to start a new state lineage for the pipeline, which would require a number of changes throughout the controller, worker, and state system. However, long-term this will be solved by a more sophisticated system of pipelines and jobs, where we create a new job for a new state lineage.

While that redesign remains in the future, this PR implements the same idea in a somewhat hacky way: when restarting a leader-mode pipeline without state, we simply replace the existing job with a new one. As checkpoints are stored by job_id, this addresses the need here without any worker or state specific code. There is some risk of introducing multiple running jobs as there is no explicit synchronization with the controller, however we mitigate by restricting these operations to pipelines in Failed or Stopped.

This PR also adds a "start without state" option and button the UI, so this is not just limited to failed pipelines.


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread crates/arroyo-api/src/pipelines.rs
@mwylde
mwylde merged commit fa575e4 into master Aug 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant