918
d.syncTaskQueuesAsync(ctx, args.RoutingConfig, versionDataChanged)
919
} else {
921
>
newStatus = d.findNewVersionStatus(args)
922
>
versionData := &deploymentspb.DeploymentVersionData{
923
>
Version: d.VersionState.Version,
924
>
RoutingUpdateTime: args.RoutingUpdateTime,
925
>
CurrentSinceTime: args.CurrentSinceTime,
926
>
RampingSinceTime: args.RampingSinceTime,
927
>
RampPercentage: args.RampPercentage,
928
>
Status: newStatus,
929
>
}
930
>
931
>
// sync version information to all the task queues
932
>
err = d.syncVersionDataToTaskQueues(ctx, versionData)
933
>
if err != nil {
934
// TODO (Shivam): Compensation functions required to roll back the local state + activity changes.
935
return nil, err
936
}
937
// apply changes to current and ramping
939
>
state.RoutingUpdateTime = args.RoutingUpdateTime
940
>
state.CurrentSinceTime = args.CurrentSinceTime
941
>
state.RampingSinceTime = args.RampingSinceTime
942
>
state.RampPercentage = args.RampPercentage
943
>
944
>
// Only needed for v0 workflow version. v1 and v2 are handled by updateStateFromRoutingConfig.
945
>
if newStatus == enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT &&
946
>
(state.LastCurrentTime == nil || state.LastCurrentTime.AsTime().Before(args.RoutingUpdateTime.AsTime())) {
947
// Last time this version was set to current
948
state.LastCurrentTime = args.RoutingUpdateTime