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

Add VersioningBehaviorOverride to StartWorkflowExecutionRequest #477

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

carlydf
Copy link
Contributor

@carlydf carlydf commented Nov 14, 2024

Add VersioningBehaviorOverride to StartWorkflowExecutionRequest

So that users can implement their own deployment checks by sending a test workflow to a specific deployment, before ramping traffic on that deployment.

Breaking changes

Server PR

@carlydf carlydf requested review from a team as code owners November 14, 2024 19:21
@@ -201,6 +201,9 @@ message StartWorkflowExecutionRequest {
temporal.api.sdk.v1.UserMetadata user_metadata = 23;
// Links to be associated with the workflow.
repeated temporal.api.common.v1.Link links = 24;
// If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.
// To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions.
temporal.api.common.v1.VersioningBehaviorOverride versioning_behavior_override = 25;
Copy link
Member

@cretz cretz Nov 14, 2024

Choose a reason for hiding this comment

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

Does this need to also be added to SignalWithStartWorkflowExecutionRequest for signal with start and NewWorkflowExecutionInfo for schedules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is primarily to enable customers to write canary workflows and start/run them on a specific worker deployment that they want to test. I could see people wanting to do that with schedules, not sure if people would want to do that with SignalWithStart, but there's no harm in giving them the option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just added it to both of those

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it will also need to be added to internal.StartWorkflowOptions in sdk-go

Copy link
Member

@cretz cretz Nov 14, 2024

Choose a reason for hiding this comment

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

From an SDK POV, probably to every start workflow options in every language (Go is not more important than the others)

@carlydf carlydf requested review from ShahabT, a team and Shivs11 November 14, 2024 19:29
@antlai-temporal
Copy link
Contributor

One thing about error handling. The override specifies a deployment and a build id. We also pass the task queue name when starting a workflow. Is there any check in the server that the task queue belongs to the deployment? Maybe the answer is no check and the workflow times out, but a comment on this would be useful...

Copy link
Member

@Shivs11 Shivs11 left a comment

Choose a reason for hiding this comment

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

🚀
minor nit: we should probably update this comment in the already merged API to now state that we are using versioning_behavior_override in places like SignalWithStart

@Shivs11
Copy link
Member

Shivs11 commented Nov 15, 2024

One thing about error handling. The override specifies a deployment and a build id. We also pass the task queue name when starting a workflow. Is there any check in the server that the task queue belongs to the deployment? Maybe the answer is no check and the workflow times out, but a comment on this would be useful...

@antlai-temporal - asking just to ensure we are on the same page - you specifically mean using the override during an update to get out of bad situations right? I think care should be taken on the server side and we will have a check to verify that the task-queue is in the right deployment before we do move it out and place it into a different one

@antlai-temporal
Copy link
Contributor

One thing about error handling. The override specifies a deployment and a build id. We also pass the task queue name when starting a workflow. Is there any check in the server that the task queue belongs to the deployment? Maybe the answer is no check and the workflow times out, but a comment on this would be useful...

@antlai-temporal - asking just to ensure we are on the same page - you specifically mean using the override during an update to get out of bad situations right? I think care should be taken on the server side and we will have a check to verify that the task-queue is in the right deployment before we do move it out and place it into a different one

No, this API is to start a new workflow on a particular deployment. When you start a workflow you also need to specify the task queue. The question is if we make a mistake the deployment may not include that queue. Since task queue membership in a deployment is eventually consistent (triggered by worker polling), we may not want to throw an error, and wait until the workflow timeout...

@ShahabT
Copy link
Contributor

ShahabT commented Nov 15, 2024

we may not want to throw an error, and wait until the workflow timeout

Correct. This is possible for pinned overrides. If they pinned to the wrong deployment its like starting the wf on a non-existing task queue. We assume user knows what they are doing. In UI we'll show a watning that "there is no poller for this TQ + deployment".

@ShahabT
Copy link
Contributor

ShahabT commented Nov 18, 2024

@carlydf I think you should add the override to WorkflowExecutionStartedEventAttributes as well.

@carlydf carlydf merged commit 2c1176c into versioning-3 Nov 20, 2024
2 checks passed
@carlydf carlydf deleted the cdf/start-with-override branch November 20, 2024 00:17
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.

5 participants