#2861 [BUG] Recovery of dynamic tasks may result in duplicate evaluations
Issue created by
hamersaw
Describe the bug
The
node recovery lookup operations use a node ID to retrieve the most recent node execution. Since task event version 1 these
node IDs are fully qualified, meaning they include parent node information (ie. parent node ID and retry attempt). For example, a node "n1" in the dynamic task, which is node "n0" in the parent workflow will have the fully qualified nodeID "n0-0-n1" for retry attempt 0. If the dynamic task parent task fails to execute and is retried, then the node ID will be "n0-1-n1".
This is problematic when checking previous node executions during workflow recovery operations. A recovering workflow does not know which retry attempt of the dynamic task may have been successful an therefore must analyze every possible attempt to ensure correctness. In the case of large configured max retires (ex. 50) this can include many calls to flyteadmin for each recovered node. Also, in the case of nested dynamic tasks this becomes impossible.
It should be noted that this does not result in incorrect behavior. Rather, the node evaluation will just be recomputed in the recovered workflow although it may have successfully completed previously.
Expected behavior
The workflow recovery mechanism should be able to identify all nodes that have previously been completed successfully and fully recover them without duplicate evaluations. One potential solution is to implement an additional FlyteAdmin API that returns the latest successful execution of a node.
Additional context to reproduce
1. Start a workflow containing a dynamic task.
2. Manually delete the dynamic tasks parent task pod (to force a retry of the dynamic task)
3. Allow (at least) one node in the dynamic to complete successfully
4. Manually delete pods (or force failures in task definition) to ensure one of the dynamic task subnodes fails permanently.
5. Recover the workflow and see execution of nodes that were successfully completed in the previous execution.
Screenshots
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyte