Skip to content

[V2] flyte recover - #7825

Open
popojk wants to merge 16 commits into
mainfrom
recover-design-doc
Open

[V2] flyte recover#7825
popojk wants to merge 16 commits into
mainfrom
recover-design-doc

Conversation

@popojk

@popojk popojk commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tracking issue

Why are the changes needed?

Introduce recover into OSS. When executing flyte rerun <run_name> recover, the backend will look up if the child action executions result executed in prior run execution, and skip pod creation if the action result is found.

What changes were proposed in this pull request?

Backend changes, design concept is detailed in the design doc.

How was this patch tested?

Execute python examples/basics/devbox_one.py, then run flyte rerun <run_name> recover.
Screenshot 2026-08-21 at 10 28 57 AM

We can also force rerun an action with flyte rerun r7wstb4fdhsfl8v9nh2n --recover --force-rerun-action 7qvx2tqthogpce3w0cs5754mo. The action pod will be created
Screenshot 2026-08-21 at 10 35 06 AM

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Stack

If you do use git town to manage PR Stacks, the stack relevant to this PR
will show below. Otherwise, you can ignore this section.

Docs link

popojk added 2 commits August 11, 2026 14:09
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>

```go
// executor/api/v1/taskaction_types.go
type RecoveredFrom struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good yes write the context to task action and then executor can just circle back and write the recovered phase and propagate the phase to ui too

@pingsutw pingsutw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks

popojk added 4 commits August 20, 2026 09:53
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
@popojk popojk changed the title Recover design doc [V2] flyte recover Aug 21, 2026
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
@popojk popojk added the blocked This work depends on an upstream change label Aug 21, 2026
@popojk

popojk commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

We should wait for the UI PR merge in first. Then we can merge this PR with new UI image

@popojk popojk removed the blocked This work depends on an upstream change label Sep 2, 2026

@pingsutw pingsutw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested recover with condition task, but it didn't work.

@@ -0,0 +1,346 @@
# Run Recovery — design

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we move it to https://github.com/flyteorg/flyte/tree/main/docs/rfcs and add a date prefix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8e65bfe

// found = false rather than an error: recovery is fail-open, and a miss is an ordinary outcome.
message LookupActionResponse {
// Whether the run has an action of that name.
bool found = 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we return grpc CodeNotFound instead of adding another field here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e5278ee

Comment thread actions/k8s/recovery.go
Comment on lines +90 to +92
if relation.GetRelationType() != common.RelationType_RELATION_TYPE_RECOVER || source == nil {
return nil
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we check the relation type here?

flyte/actions/k8s/client.go

Lines 1086 to 1090 in bf62df5

recoveryContext, err := recoveryContextFromRunSpec(runSpec)
if err != nil {
return err
}
taskAction.Spec.RecoveryContext = recoveryContext

if it's not recover, we should not set the recover context in the crd

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we already did that check here in recoveryContextFromRunSpec, so the recoverContext will be nil if it is not a recover action.

Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
@popojk

popojk commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

I tested recover with condition task, but it didn't work.

@pingsutw I fixed this issue in 8f10ddf to make condition recovery works. Could you help review again? Thanks!

Signed-off-by: Alex Wu <c.alexwu@gmail.com>
@popojk
popojk requested a review from pingsutw September 3, 2026 03:52
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants