task_queue_partition_manager.go ×6

Frontier kind: Code frontier

unlabeled · c_84fbd77fe35c

9 tests · 5200 LOC · 188 files · introduces 0 tests · 22 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges22 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1069 ranges5200 lines · 188 files · Browse complete extent
All tests (intent)
9 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: 22 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

799 var versionSet string
800 if versioningData.GetVersionSets() != nil {
801 > versionSet, err = pm.getVersionSetForPoll(pollMetadata.workerVersionCapabilities, versioningData) task_queue_partition_manager.go
802 > if err != nil {
803 return nil, false, err
804 }
2071 caps *commonpb.WorkerVersionCapabilities,
2072 versioningData *persistencespb.VersioningData,
2073 > ) (string, error) { task_queue_partition_manager.go
2074 > primarySetId, demotedSetIds, unknownBuild, err := lookupVersionSetForPoll(versioningData, caps)
2075 > if err != nil {
2076 return "", err
2077 }
2078 > if unknownBuild { task_queue_partition_manager.go
2079 // if the build ID is unknown, we assume user is using the new API
2080 return "", nil
2291 // assume user wants to use the new API
2292 if len(data.GetVersionSets()) > 0 {
2293 > versionSet, err = pm.getVersionSetForAdd(directive, data) task_queue_partition_manager.go
2294 > if err != nil {
2295 return nil, nil, nil, 0, nil, err
2296 }
2378 case *taskqueuespb.TaskVersionDirective_UseAssignmentRules:
2379 // leave buildId = "", lookupVersionSetForAdd understands that to mean "default"
2380 > case *taskqueuespb.TaskVersionDirective_AssignedBuildId: task_queue_partition_manager.go
2381 > buildId = dir.AssignedBuildId
2382 default:
2383 // Unversioned task, leave on unversioned queue.
2392 return "", err
2393 }
2394 > if unknownBuild { task_queue_partition_manager.go
2395 // this could happen in two scenarios:
2396 // - task queue is switching to the new versioning API and the build ID is not registered in version sets.
go.temporal.io/server/service/matching/version_sets.go 11 introduced LOC · 2 ranges

Open complete file

329 // - whether the primary set id was guessed (as opposed to found in versioning data)
330 // - error (can only be nil or serviceerror.NewerBuildExists)
331 > func lookupVersionSetForPoll(data *persistencespb.VersioningData, caps *commonpb.WorkerVersionCapabilities) (string, []string, bool, error) { version_sets.go
332 > // For poll, only the latest version in the compatible set can get tasks.
333 > // Find the version set that this worker is in.
334 > // Note data may be nil here, findVersion will return -1 then.
335 > setIdx, indexInSet := worker_versioning.FindBuildId(data, caps.BuildId)
336 > if setIdx < 0 {
337 // A poller is using a build ID but we don't know about that build ID. This can happen
338 // in a replication scenario if pollers are running on the passive side before the data
398 }
399 set = data.VersionSets[setLen-1]
400 > } else { version_sets.go
401 > // For add, any version in the compatible set maps to the set.
402 > // Note data may be nil here, findVersion will return -1 then.
403 > setIdx, _ := worker_versioning.FindBuildId(data, buildId)
404 > if setIdx < 0 {
405 // A workflow has a build ID set, but we don't know about that build ID. This can
406 // happen in replication scenario: the workflow itself was migrated and we failed