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

IsTerminatedByResetter should not be used for checking if child workflow should report to parent #6954

Open
yycptt opened this issue Dec 7, 2024 · 0 comments

Comments

@yycptt
Copy link
Member

yycptt commented Dec 7, 2024

Expected Behavior

  • A reset operation involves three runs: base run, current run and reset (new) run. If current run is running when processing a reset, it will be terminated. If current run is also a child workflow, then there's a question if it should report to its parent after the termination.
  • If current run is base run, then we should not report to parent, as we will have a new run for the child.
  • If current run is not base run, then we should report to parent as the new run is not a continuation of the current run.

Actual Behavior

  • In the replyToParentWorkflow logic, we are checking if the current run is terminated by reset or not, which is not checking if current run is the base run.

We should use the new ResetRunId field in WorkflowExecutionInfo, which is only set when the workflow is the base run of a reset. However, note that with today's event-based replication stack, this ResetRunID field won't be replicated upon reset. So if we switch to that field now, we will temporary make things worse (if failover happens before the closeExecution task is processed) until state-based replication goes live.

To fix the issue before state-based replication, we can:

  1. Change existing replication logic and instead of generating a historyReplicationTask when workflow is closed, generate a SyncWorkflowState task (yes we have this sync state task in event-based world as well, but only works for closed workflow)
  2. Add some new fields to the Terminated event to indicate if the workflow is base run.

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant