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

Replicate workflow state #2852

Merged
merged 12 commits into from
May 20, 2022
Merged

Replicate workflow state #2852

merged 12 commits into from
May 20, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented May 16, 2022

What changed?
Allow replicate workflow state.

Why?
Allow replicate workflow state for namespace migration optimization.

How did you test it?
TODO: unit tests

Potential risks

Is hotfix candidate?

Comment on lines 69 to 72
CreateWorkflowModeUpdateCurrent
// CreateWorkflowModeZombie do not update current record since workflow is in zombie state
// applicable for CreateWorkflowExecution, UpdateWorkflowExecution
CreateWorkflowModeZombie
CreateWorkflowModeBypassCurrent
Copy link
Member

Choose a reason for hiding this comment

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

update comments

if workflowState == enumsspb.WORKFLOW_EXECUTION_STATE_CREATED ||
workflowState == enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING ||
workflowState == enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED {
workflowState == enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING {
Copy link
Member

Choose a reason for hiding this comment

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

I think WORKFLOW_EXECUTION_STATE_COMPLETED is still possible, isn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the current workflow vector clock is newer than the incoming closed workflow, then we can still create the closed workflow and not update the current record.

@yux0 yux0 marked this pull request as ready for review May 18, 2022 17:50
@yux0 yux0 requested a review from a team as a code owner May 18, 2022 17:50
@yux0 yux0 merged commit 150516a into temporalio:master May 20, 2022
@yux0 yux0 deleted the sync-wf-state branch May 20, 2022 06:27
Sushisource pushed a commit to Sushisource/temporal that referenced this pull request Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants