Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to reset workflow with completed childworkflow whose child workflowID is generated by SDK #723

Open
yycptt opened this issue Feb 10, 2022 · 2 comments · May be fixed by #1557
Open

Comments

@yycptt
Copy link
Member

yycptt commented Feb 10, 2022

Expected Behavior

When reseting a workflow with no pending child execution. (Reset with pending child currently is not supported.)
After reset, parent workflow should continue execution without any error

Actual Behavior

After reset, parent workflow will encounter a non-deterministic error during replay. The error happens when processing the child workflow init event and can't find the corresponding child workflow command/state machine.

The root cause is we use child workflow ID to find the corresponding command. However if child workflowID is not specified in child option, SDK will automatically generate one based on the workflow's runID. After reset, the workflow's runID changes but in workflow history the child workflow ID is still based on the original runID. Hence the not found and non-deterministic error.

Steps to Reproduce the Problem

  1. Run a workflow with a child workflow. Do NOT specify the childworkflow ID in child option.
  2. Reset the workflow to an event_id after the child workflow completed event. Any workflow task close event (completed/failed/timeout) will work.
  3. Check the new workflow's history, the workflow task will fail due to non-deterministic error.

Specifications

  • Version:
  • Platform:
@yycptt
Copy link
Member Author

yycptt commented Feb 10, 2022

Server stores a workflow's original runID (in workflow start event) which won't change during reset. So one potential solution is generate child workflow ID based on this original runID.

But this solution may conflict with some future work related to reset.
@yiminc Would you mind provide some insights here? Thanks.

@askreet
Copy link

askreet commented Feb 9, 2024

I hit this in #1385. I'm curious if there's any risk in using the OriginalRunId by default in the meantime.

arithran added a commit to arithran/sdk-go that referenced this issue Jul 22, 2024
…hild workflow

Includes the following change from cadence: uber-go/cadence-client#1118
Fixes the following community issue: : temporalio#723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants