version_workflow.go ×4

Frontier kind: Code frontier

unlabeled · c_6480caf4fbe4

84 tests · 3150 LOC · 137 files · introduces 0 tests · 31 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges31 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
524 ranges3150 lines · 137 files · Browse complete extent
All tests (intent)
84 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 31 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/workerdeployment/version_workflow.go 31 introduced LOC · 4 ranges

Open complete file

918 d.syncTaskQueuesAsync(ctx, args.RoutingConfig, versionDataChanged)
919 } else {
920 > // SYNC MODE: propagate only version data (existing behavior) version_workflow.go
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
938 > state.Status = newStatus version_workflow.go
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
1181 // findNewVersionStatus is a helper to find the new version status a version will have after it a successful sync to
1182 // all its task queues.
1183 > func (d *VersionWorkflowRunner) findNewVersionStatus(args *deploymentspb.SyncVersionStateUpdateArgs) enumspb.WorkerDeploymentVersionStatus { version_workflow.go
1184 > state := d.GetVersionState()
1185 >
1186 > wasAcceptingNewWorkflows := state.GetCurrentSinceTime() != nil || state.GetRampingSinceTime() != nil
1187 > isAcceptingNewWorkflows := args.CurrentSinceTime != nil || args.RampingSinceTime != nil
1188 >
1189 > if wasAcceptingNewWorkflows && !isAcceptingNewWorkflows {
1190 return enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING
1191 > } else if args.CurrentSinceTime != nil { version_workflow.go
1192 return enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT
1193 } else if args.RampingSinceTime != nil {