worker_versioning.go ×6

Frontier kind: Code frontier

unlabeled · c_4472c008c1a2

10 tests · 4712 LOC · 183 files · introduces 0 tests · 23 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges23 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
906 ranges4712 lines · 183 files · Browse complete extent
All tests (intent)
10 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.

2 files ranked by introduced lines: 23 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/task_queue_partition_manager.go 14 introduced LOC · 6 ranges

Open complete file

2165
2166 if wfBehavior == enumspb.VERSIONING_BEHAVIOR_PINNED {
2167 > if pm.partition.Kind() == enumspb.TASK_QUEUE_KIND_STICKY { task_queue_partition_manager.go
2168 // TODO (shahab): we can verify the passed deployment matches the last poller's deployment
2169 return dbq, dbq, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
2170 }
2171
2172 > err = worker_versioning.ValidateDeployment(deployment) task_queue_partition_manager.go
2173 > if err != nil {
2174 return nil, nil, nil, 0, nil, err
2175 }
2176
2177 // Preventing Query tasks from being dispatched to a drained version with no workers
2178 > if isQuery { task_queue_partition_manager.go
2179 if err := pm.checkQueryBlackholed(deploymentData, deployment); err != nil {
2180 return nil, nil, nil, 0, nil, err
2186 // independent activities and are treated as unpinned, sent to their TQ's current deployment.
2187
2188 > var isIndependentPinnedActivity bool task_queue_partition_manager.go
2189 > if pm.partition.TaskType() == enumspb.TASK_QUEUE_TYPE_ACTIVITY {
2190 // We need to check both the deployment data formats to be sure if we can ignore the pinned directive on the activity task.
2191 if !worker_versioning.HasDeploymentVersion(deploymentData, worker_versioning.DeploymentVersionFromDeployment(deployment)) {
2194 }
2195
2196 > if !isIndependentPinnedActivity { task_queue_partition_manager.go
2197 > pinnedQueue, err := pm.getVersionedQueue(ctx, "", "", deployment, true)
2198 > if err != nil {
2199 return nil, nil, nil, 0, nil, err
2200 }
2201 > if forwardInfo == nil { task_queue_partition_manager.go
2202 > // Task is not forwarded, so it can be spooled if sync match fails.
2203 > // Spool queue and sync match queue is the same for pinned workflows.
2204 > return pinnedQueue, pinnedQueue, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
2205 > } else {
2206 // Forwarded from child partition - only do sync match.
2207 return nil, pinnedQueue, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
go.temporal.io/server/common/worker_versioning/worker_versioning.go 9 introduced LOC · 6 ranges

Open complete file

568 // ValidateDeployment returns error if the deployment is nil or it has empty build ID or deployment
569 // name.
570 > func ValidateDeployment(deployment *deploymentpb.Deployment) error { worker_versioning.go
571 > if deployment == nil {
572 return serviceerror.NewInvalidArgument("deployment cannot be nil")
573 }
574 > if deployment.GetSeriesName() == "" { worker_versioning.go
575 return serviceerror.NewInvalidArgument("deployment name cannot be empty")
576 }
577 // TODO: remove '.' restriction once the v31 version strings are completely cleaned from external and internal API
578 > if strings.Contains(deployment.GetSeriesName(), WorkerDeploymentVersionIDDelimiterV31) || worker_versioning.go
579 > strings.Contains(deployment.GetSeriesName(), WorkerDeploymentVersionDelimiter) {
580 return serviceerror.NewInvalidArgumentf("deployment name cannot contain '%s' or '%s'", WorkerDeploymentVersionIDDelimiterV31, WorkerDeploymentVersionDelimiter)
581 }
582 > if deployment.GetBuildId() == "" { worker_versioning.go
583 return serviceerror.NewInvalidArgument("deployment build ID cannot be empty")
584 }
585 > return nil worker_versioning.go
586 }
587
1106 func DirectiveDeployment(directive *taskqueuespb.TaskVersionDirective) *deploymentpb.Deployment {
1107 if dv := directive.GetDeploymentVersion(); dv != nil {
1108 > return DeploymentFromDeploymentVersion(dv) worker_versioning.go
1109 > }
1110 return directive.GetDeployment()
1111 }