-
Notifications
You must be signed in to change notification settings - Fork 850
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
Support unpinned workflows #6887
base: versioning-3
Are you sure you want to change the base?
Conversation
…g-behaviors # Conflicts: # api/deployment/v1/message.go-helpers.pb.go # api/deployment/v1/message.pb.go # common/worker_versioning/worker_versioning.go # proto/internal/temporal/server/api/deployment/v1/message.proto
…g-behaviors # Conflicts: # api/persistence/v1/executions.pb.go # service/matching/task_queue_partition_manager.go
…shahab/transfer-versioning-info # Conflicts: # service/history/workflow/mutable_state_impl.go
…er-versioning-info # Conflicts: # api/deployment/v1/message.pb.go # api/historyservice/v1/request_response.pb.go # api/persistence/v1/tasks.pb.go # api/taskqueue/v1/message.pb.go # proto/internal/temporal/server/api/deployment/v1/message.proto # proto/internal/temporal/server/api/historyservice/v1/request_response.proto
…haviors # Conflicts: # common/worker_versioning/worker_versioning.go
…er-versioning-info
…g-behaviors # Conflicts: # common/worker_versioning/worker_versioning.go # service/history/workflow/util.go
func Deployment(deployment *deployment.Deployment) ZapTag { | ||
val := "UNVERSIONED" | ||
if deployment != nil { | ||
val = deployment.SeriesName + ":" + deployment.GetBuildId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use GetXXX()
format everywhere for consistency. Also all these log tag thing is aiming to 0 allocations and 0 overhead if tag is not used but I guess there is no good way to make it work here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make deployment
a string
here and call DeploymentToString
before passing deployment to this func. Let's make tags trivial simple.
@@ -110,7 +110,7 @@ message VersioningData { | |||
message DeploymentData { | |||
// Set of deployments that this task queue belongs to. | |||
// Current deployment is defined implicitly as the deployment with the most recent last_became_current_time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you specify TaskQueueData.last_became_current_time
?
@@ -110,7 +110,7 @@ message VersioningData { | |||
message DeploymentData { | |||
// Set of deployments that this task queue belongs to. | |||
// Current deployment is defined implicitly as the deployment with the most recent last_became_current_time. | |||
repeated Deployment deployment = 1; | |||
repeated Deployment deployments = 1; | |||
|
|||
message Deployment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This nested Deployment
is a bad sign. DeploymentDataItem
?
} | ||
wfDeployment := mutableState.GetEffectiveDeployment() | ||
if !directiveDeployment.Equal(wfDeployment) { | ||
// This must be a task scheduled before the workflow transitions to the current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same way as we refer "workflow task" as WFT everywhere in comments, I would suggest to refer "activity task" as AT, not just "task".
return nil, serviceerrors.NewObsoleteMatchingTask("wrong task queue type") | ||
} | ||
|
||
dispatchDeployment := worker_versioning.DeploymentFromCapabilities(req.PollRequest.WorkerVersionCapabilities) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispatchDeployment := worker_versioning.DeploymentFromCapabilities(req.PollRequest.WorkerVersionCapabilities) | |
pollerDeployment := worker_versioning.DeploymentFromCapabilities(req.PollRequest.WorkerVersionCapabilities) |
} | ||
|
||
dispatchDeployment := worker_versioning.DeploymentFromCapabilities(req.PollRequest.WorkerVersionCapabilities) | ||
directiveDeployment := req.GetDirectiveDeployment() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directiveDeployment := req.GetDirectiveDeployment() | |
scheduledDeployment := req.GetScheduledDeployment() |
-- deployment which history wanted when it scheduled a WFT.
if errors.Is(err, workflow.ErrPinnedWorkflowCannotTransition) { | ||
// This must be a task from a time that the workflow was unpinned, but it's | ||
// now pinned so can't transition. Matching can drop the task safely. | ||
return nil, serviceerrors.NewObsoleteMatchingTask("workflow is not eligible for transition") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, serviceerrors.NewObsoleteMatchingTask("workflow is not eligible for transition") | |
return nil, serviceerrors.NewObsoleteMatchingTask(workflow.ErrPinnedWorkflowCannotTransition.Error()) |
What changed?
Add Matching and History changes to properly route unpinned workflow tasks.
Why?
How did you test it?
Tests will come in separate PR.
Potential risks
Documentation
Is hotfix candidate?