Skip to content

Commit

Permalink
Remove build id from sticky recordWorkflowTaskStarted (#6096)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahabT authored and stephanos committed Jun 13, 2024
1 parent 09dd942 commit b7e4b18
Show file tree
Hide file tree
Showing 3 changed files with 370 additions and 31 deletions.
5 changes: 3 additions & 2 deletions service/history/workflow_task_handler_callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,9 @@ func (handler *workflowTaskHandlerCallbacksImpl) handleWorkflowTaskCompleted(
return nil, serviceerror.NewNotFound("Workflow task not found.")
}

if assignedBuildId := ms.GetAssignedBuildId(); assignedBuildId != "" {
// worker versioning is used, make sure the task was completed by the right build ID
if assignedBuildId := ms.GetAssignedBuildId(); assignedBuildId != "" && !ms.IsStickyTaskQueueSet() {
// Worker versioning is used, make sure the task was completed by the right build ID, unless we're using a
// sticky queue in which case Matching will not send the build ID
wftStartedBuildId := ms.GetExecutionInfo().GetWorkflowTaskBuildId()
wftCompletedBuildId := request.GetWorkerVersionStamp().GetBuildId()
if wftCompletedBuildId != wftStartedBuildId {
Expand Down
6 changes: 5 additions & 1 deletion service/matching/version_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,11 @@ func checkVersionForStickyPoll(data *persistencespb.VersioningData, caps *common
// A poller is using a build ID, but we don't know about that build ID. See comments in
// lookupVersionSetForPoll. If we consider it the default for its set, then we should
// leave it on the sticky queue here.
return false, nil
// We set return true for all sticky tasks until old versioning is cleaned up.
// this value is used by matching_engine for deciding if it should pass the worker build ID
// to history in the recordStart call or not. We don't need to pass build ID for sticky
// tasks as no redirect happen in a sticky queue.
return true, nil
}
set := data.VersionSets[setIdx]
lastIndex := len(set.BuildIds) - 1
Expand Down
Loading

0 comments on commit b7e4b18

Please sign in to comment.