task_queue_partition_manager.go ×6

Frontier kind: Code frontier

unlabeled · c_8ed2d9ca8158

6 tests · 5245 LOC · 188 files · introduces 0 tests · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges27 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1087 ranges5245 lines · 188 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: 27 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

807 // use version set if found, otherwise assume user is using new API
808 if versionSet != "" {
809 > versionSetUsed = true task_queue_partition_manager.go
810 > dbq, err = pm.getVersionedQueue(ctx, versionSet, "", nil, true)
811 } else {
812 activeRules := getActiveRedirectRules(versioningData.GetRedirectRules())
2080 return "", nil
2081 }
2082 > pm.loadDemotedSetIds(demotedSetIds) task_queue_partition_manager.go
2083 >
2084 > return primarySetId, nil
2085 }
2086
2087 > func (pm *taskQueuePartitionManagerImpl) loadDemotedSetIds(demotedSetIds []string) { task_queue_partition_manager.go
2088 > // If we have demoted set ids, we need to load all task queues for them because even though
2089 > // no new tasks will be sent to them, they might have old tasks in the db.
2090 > // Also mark them alive, so that their liveness will be roughly synchronized.
2091 > // TODO: once we know a demoted set id has no more tasks, we can remove it from versioning data
2092 > for _, demotedSetId := range demotedSetIds {
2093 tqm, _ := pm.getVersionedQueueNoWait(demotedSetId, "", nil, true)
2094 if tqm != nil {
2325
2326 if versionSet != "" {
2327 > spoolQueue = pm.defaultQueue() task_queue_partition_manager.go
2328 > if spoolQueue == nil {
2329 return nil, nil, nil, 0, nil, errDefaultQueueNotInit
2330 }
2331 > syncMatchQueue, err = pm.getVersionedQueue(ctx, versionSet, "", nil, true) task_queue_partition_manager.go
2332 > if err != nil {
2333 return nil, nil, nil, 0, nil, err
2334 }
go.temporal.io/server/service/matching/version_sets.go 11 introduced LOC · 5 ranges

Open complete file

346 return guessedSetId, nil, true, nil
347 }
348 > set := data.VersionSets[setIdx] version_sets.go
349 > lastIndex := len(set.BuildIds) - 1
350 > if indexInSet != lastIndex {
351 return "", nil, false, serviceerror.NewNewerBuildExists(set.BuildIds[lastIndex].Id)
352 }
353 > primarySetId, demotedSetIds := getSetIds(set) version_sets.go
354 > return primarySetId, demotedSetIds, false, nil
355 }
356
415 return guessedSetId, true, nil
416 }
417 > set = data.VersionSets[setIdx] version_sets.go
418 }
419 // Demoted set ids don't matter for add, we always write to the primary.
420 > primarySetId, _ := getSetIds(set) version_sets.go
421 > return primarySetId, false, nil
422 }
423
457 // handling of spooled tasks in Add, this does need to be an actual set id, not an arbitrary
458 // string.)
459 > func getSetIds(set *persistencespb.CompatibleVersionSet) (string, []string) { version_sets.go
460 > return set.SetIds[0], set.SetIds[1:]
461 > }
462
463 // ClearTombstones clears all tombstone build ids (with STATE_DELETED) from versioning data.