Skip to content

Commit 1caad86

Browse files
Patch PR #7852 into cloud/v1.28.0-134 (#7863)
Commit changes from pull request (#7852) into cloud/v1.28.0-134 1a9cb61 - Do not set sticky queue if a transition is ongoing Co-authored-by: temporal-cicd[bot] <temporal-cicd[bot]@users.noreply.github.com>
1 parent 92c7cc9 commit 1caad86

File tree

1 file changed

+4
-1
lines changed
  • service/history/api/respondworkflowtaskcompleted

1 file changed

+4
-1
lines changed

service/history/api/respondworkflowtaskcompleted/api.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"go.temporal.io/server/common/persistence/visibility/manager"
3131
"go.temporal.io/server/common/searchattribute"
3232
"go.temporal.io/server/common/tasktoken"
33+
"go.temporal.io/server/common/worker_versioning"
3334
"go.temporal.io/server/service/history/api"
3435
"go.temporal.io/server/service/history/api/recordworkflowtaskstarted"
3536
"go.temporal.io/server/service/history/configs"
@@ -193,6 +194,7 @@ func (handler *WorkflowTaskCompletedHandler) Invoke(
193194
}
194195

195196
behavior := request.GetVersioningBehavior()
197+
deployment := worker_versioning.DeploymentFromDeploymentVersion(worker_versioning.DeploymentVersionFromOptions(request.GetDeploymentOptions()))
196198
//nolint:staticcheck // SA1019 deprecated Deployment will clean up later
197199
if behavior != enumspb.VERSIONING_BEHAVIOR_UNSPECIFIED && request.GetDeployment() == nil &&
198200
(request.GetDeploymentOptions() == nil || request.GetDeploymentOptions().GetWorkerVersioningMode() != enumspb.WORKER_VERSIONING_MODE_VERSIONED) {
@@ -306,7 +308,8 @@ func (handler *WorkflowTaskCompletedHandler) Invoke(
306308
metrics.CompleteWorkflowTaskWithStickyEnabledCounter.With(handler.metricsHandler).Record(
307309
1,
308310
metrics.OperationTag(metrics.HistoryRespondWorkflowTaskCompletedScope))
309-
if assignedBuildId == "" || assignedBuildId == wftCompletedBuildId {
311+
if (assignedBuildId == "" || assignedBuildId == wftCompletedBuildId) &&
312+
(ms.GetDeploymentTransition() == nil || ms.GetDeploymentTransition().GetDeployment().Equal(deployment)) {
310313
// TODO: clean up. this is not applicable to V3
311314
// For versioned workflows, only set sticky queue if the WFT is completed by the WF's current build ID.
312315
// It is possible that the WF has been redirected to another build ID since this WFT started, in that case

0 commit comments

Comments
 (0)