worker_versioning.go ×6

Frontier kind: Joint frontier

unlabeled · c_d97c6dbc9e3b

1 test · 7552 LOC · 203 files · introduces 1 test · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges27 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1707 ranges7552 lines · 203 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

go.temporal.io/server/common/worker_versioning/worker_versioning.go 16 introduced LOC · 6 ranges

Open complete file

192 func DeploymentFromCapabilities(capabilities *commonpb.WorkerVersionCapabilities, options *deploymentpb.WorkerDeploymentOptions) (*deploymentpb.Deployment, error) {
193 if options.GetWorkerVersioningMode() == enumspb.WORKER_VERSIONING_MODE_VERSIONED {
194 > d := options.GetDeploymentName() worker_versioning.go
195 > b := options.GetBuildId()
196 > if d == "" {
197 return nil, serviceerror.NewInvalidArgumentf("versioned worker must have deployment name")
198 }
199 > if b == "" { worker_versioning.go
200 return nil, serviceerror.NewInvalidArgumentf("versioned worker must have build id")
201 }
202 > if strings.Contains(d, WorkerDeploymentVersionDelimiter) || strings.Contains(d, WorkerDeploymentVersionIDDelimiterV31) { worker_versioning.go
203 // TODO: allow '.' once we get rid of v31 stuff
204 return nil, serviceerror.NewInvalidArgumentf("deployment name cannot contain '%s' or '%s'", WorkerDeploymentVersionDelimiter, WorkerDeploymentVersionIDDelimiterV31)
205 }
206 > return &deploymentpb.Deployment{ worker_versioning.go
207 > SeriesName: d,
208 > BuildId: b,
209 > }, nil
210 }
211 if capabilities.GetUseVersioning() && capabilities.GetDeploymentSeriesName() != "" && capabilities.GetBuildId() != "" {
234 func DeploymentVersionFromOptions(options *deploymentpb.WorkerDeploymentOptions) *deploymentspb.WorkerDeploymentVersion {
235 if options.GetWorkerVersioningMode() == enumspb.WORKER_VERSIONING_MODE_VERSIONED {
236 > return &deploymentspb.WorkerDeploymentVersion{ worker_versioning.go
237 > DeploymentName: options.GetDeploymentName(),
238 > BuildId: options.GetBuildId(),
239 > }
240 > }
241 return nil
242 }
407 for _, vd := range deployments.GetVersions() {
408 if proto.Equal(v, vd.GetVersion()) {
409 > return true worker_versioning.go
410 > }
411 }
412
go.temporal.io/server/service/matching/task_queue_partition_manager.go 11 introduced LOC · 4 ranges

Open complete file

749
750 if deployment != nil {
751 > if pm.partition.Kind() == enumspb.TASK_QUEUE_KIND_STICKY { task_queue_partition_manager.go
752 // TODO: reject poller of old sticky queue if newer version exist
754 > // default queue should stay alive even if requests go to other queues
755 > dbq.MarkAlive()
756 > dbq, err = pm.getVersionedQueue(ctx, "", "", deployment, true)
757 >
758 > if err != nil {
759 return nil, false, err
760 }
867 deployment := physicalQueue.QueueKey().Version().Deployment()
868 if deployment != nil {
869 > buildID = worker_versioning.ExternalWorkerDeploymentVersionToString(worker_versioning.ExternalWorkerDeploymentVersionFromDeployment(deployment)) task_queue_partition_manager.go
870 > }
871
872 partitionInfo, err := pm.Describe(ctx, map[string]bool{buildID: true}, false, true, false, false)
2188 var isIndependentPinnedActivity bool
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. task_queue_partition_manager.go
2191 > if !worker_versioning.HasDeploymentVersion(deploymentData, worker_versioning.DeploymentVersionFromDeployment(deployment)) {
2192 isIndependentPinnedActivity = true
2193 }