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

[Deployments] Sync workflow before activity tqs and batch updates #7003

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dnr
Copy link
Member

@dnr dnr commented Dec 18, 2024

What changed?

  • When the deployment workflow updates user data of task queues that are in it when the "current" state changes, update workflow before activity task queues.
  • Call the sync user data activity in batches of 100, waiting for propagation between each one.

Why?

  • Updating workflow before activity is required for handling activities on unpinned workflows, to avoid workflows getting transitioned to a deployment by an activity start and then backwards by a workflow task start.
  • Batching avoids too-large activity payloads and redoing too much work on retries.

How did you test it?

existing tests

Potential risks

the workflow logic change is guarded with GetVersion call

@dnr dnr requested a review from a team as a code owner December 18, 2024 00:16
})
}
if workflow.GetVersion(ctx, "syncToTaskQueues", workflow.DefaultVersion, 0) == workflow.DefaultVersion {
err = d.syncToTaskQueues1(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: should we call these syncToTaskQueues0 and syncToTaskQueues1 to match the version?

// Sync and wait for workflow task queues, then activity task queues, to ensure that
// workflows don't bounce between deployments due to activity/wft starts.
enumspb.TASK_QUEUE_TYPE_WORKFLOW,
enumspb.TASK_QUEUE_TYPE_ACTIVITY,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want to support Nexus tasks too. they should be synced with activities I believe.

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.

2 participants