task_queue_partition_manager.go ×2

Frontier kind: Code frontier

unlabeled · c_4c075c3df57c

6 tests · 5343 LOC · 189 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1110 ranges5343 lines · 189 files · Browse complete extent
All tests (intent)
6 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: 32 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/version_sets.go 23 introduced LOC · 2 ranges

Open complete file

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 version_sets.go
338 > // in a replication scenario if pollers are running on the passive side before the data
339 > // has been replicated. Instead of rejecting, we can guess a set id based on the build
340 > // ID. If the build ID was the first in its set on the other side, then our guess is
341 > // right and things will work out. If not, then we'll guess wrong, but when the
342 > // versioning data replicates, we'll redirect the poll to the correct set id.
343 > // In the meantime (e.g. during an ungraceful failover) we can at least match tasks
344 > // using the exact same build ID.
345 > guessedSetId := hashBuildId(caps.BuildId)
346 > return guessedSetId, nil, true, nil
347 > }
348 set := data.VersionSets[setIdx]
349 lastIndex := len(set.BuildIds) - 1
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 version_sets.go
406 > // happen in replication scenario: the workflow itself was migrated and we failed
407 > // over, but the versioning data hasn't been migrated yet. Instead of rejecting it,
408 > // we can guess a set ID based on the build ID. If the build ID was the first in
409 > // its set on the other side, then our guess is right and things will work out. If
410 > // not, then we'll guess wrong, but when we get the replication event, we'll merge
411 > // the sets and use both ids.
412 > // Note that in the add task case, we have to persist this guessed set id before we
413 > // can accept the task.
414 > guessedSetId := hashBuildId(buildId)
415 > return guessedSetId, true, nil
416 > }
417 set = data.VersionSets[setIdx]
418 }
go.temporal.io/server/service/matching/task_queue_partition_manager.go 9 introduced LOC · 2 ranges

Open complete file

2077 }
2078 if unknownBuild {
2079 > // if the build ID is unknown, we assume user is using the new API task_queue_partition_manager.go
2080 > return "", nil
2081 > }
2082 pm.loadDemotedSetIds(demotedSetIds)
2083
2393 }
2394 if unknownBuild {
2395 > // this could happen in two scenarios: task_queue_partition_manager.go
2396 > // - task queue is switching to the new versioning API and the build ID is not registered in version sets.
2397 > // - task queue is still using the old API but a failover happened before verisoning data fully propagate.
2398 > // the second case is unlikely, and we do not support it anymore considering the old API is deprecated.
2399 > return "", nil
2400 > }
2401
2402 return versionSet, nil