uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.

Home Page:https://cadenceworkflow.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset workflows contains child workflow cause non-deterministic error

yux0 opened this issue · comments

Describe the bug
Reset workflows contains child workflow cause non-deterministic error if the child workflow id is not set.

params.workflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID()

To Reproduce
Is the issue reproducible?

  • Yes

Steps to reproduce the behavior:

  1. Implement a parent workflow contains a child wf
  2. Do not set the workflow id in the child wf execution context
  3. Start the wf and wait for it to finish
  4. Reset the finished wf

Expected behavior
The workflow should be able to reset if there is no pending child wf.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
From this line:

params.workflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID()
.
The default child wf is the run id + sequence id. However, after the wf is reset, the run id will be updated and caused the non-deterministic error

Directly change this could be a non-backward compatible change. One thing we can think of is to add a side effect for this generated child workflow id

My understanding is: reset doesn't support workflow with child at all.
It is kind of next steps for rest

It doesn't support if there is pending child workflows. With finished child workflows, I think it should support