950
task *internalTask,
951
backlogQueue *PhysicalTaskQueueKey,
953
>
taskInfo := task.event.GetData()
954
>
// This task came from taskReader so task.event is always set here.
955
>
directive := taskInfo.GetVersionDirective()
956
>
assignedBuildId := backlogQueue.Version().BuildId()
957
>
if assignedBuildId != "" {
958
// construct directive based on the build ID of the spool queue
959
directive = worker_versioning.MakeBuildIdDirective(assignedBuildId)
960
}
962
>
ctx,
963
>
directive,
964
>
nil,
965
>
taskInfo.GetRunId(),
966
>
taskInfo.GetWorkflowId(),
967
>
false,
968
>
)
969
>
if err != nil {
970
return err
971
}
972
974
>
975
>
// Update the task dispatch revision number on the task since the routingConfig of the partition
976
>
// may have changed after the task was spooled.
977
>
task.taskDispatchRevisionNumber = taskDispatchRevisionNumber
978
>
979
>
// set redirect info if spoolQueue and syncMatchQueue build ids are different (V2 versioning)
980
>
if assignedBuildId != syncMatchQueue.QueueKey().Version().BuildId() {
981
task.redirectInfo = &taskqueuespb.BuildIdRedirectInfo{
982
AssignedBuildId: assignedBuildId,
983
}
985
// make sure to reset redirectInfo in case it was set in a previous loop cycle
986
task.redirectInfo = nil
987
}
988
// mark if task is being redirected from queue it was read from (V2 or V3 versioning)
990
>
if !backlogQueue.version.Deployment().Equal(newBacklogQueue.QueueKey().version.Deployment()) {
991
// Backlog queue has changed, spool to the new queue. This should happen rarely: when
992
// activity of pinned workflow was determined independent and sent to the default queue