version_workflow.go ×6

Frontier kind: Code frontier

unlabeled · c_411fca233c21

108 tests · 3041 LOC · 137 files · introduces 0 tests · 45 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges45 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
493 ranges3041 lines · 137 files · Browse complete extent
All tests (intent)
108 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.

1 file ranked by introduced lines: 45 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/workerdeployment/version_workflow.go 45 introduced LOC · 6 ranges

Open complete file

1277 // syncVersionDataToTaskQueues is a helper that syncs the provided version data to all task queues.
1278 // This function does NOT acquire the workflow lock - the caller is responsible for that.
1279 > func (d *VersionWorkflowRunner) syncVersionDataToTaskQueues(ctx workflow.Context, versionData *deploymentspb.DeploymentVersionData) error { version_workflow.go
1280 > state := d.GetVersionState()
1281 >
1282 > // sync to task queues
1283 > syncReq := &deploymentspb.SyncDeploymentVersionUserDataRequest{
1284 > Version: state.GetVersion(),
1285 > }
1286 >
1287 > // send in the task-queue families in batches of syncBatchSize
1288 > batches := make([][]*deploymentspb.SyncDeploymentVersionUserDataRequest_SyncUserData, 0)
1289 > for _, tqName := range workflow.DeterministicKeys(state.TaskQueueFamilies) {
1290 > byType := state.TaskQueueFamilies[tqName]
1291 > var types []enumspb.TaskQueueType
1292 > for _, tqType := range workflow.DeterministicKeys(byType.TaskQueues) {
1293 > types = append(types, enumspb.TaskQueueType(tqType))
1294 > }
1295
1296 > syncReq.Sync = append(syncReq.Sync, &deploymentspb.SyncDeploymentVersionUserDataRequest_SyncUserData{ version_workflow.go
1297 > Name: tqName,
1298 > Types: types,
1299 > Data: versionData,
1300 > })
1301 >
1302 > if len(syncReq.Sync) == int(d.VersionState.SyncBatchSize) {
1303 batches = append(batches, syncReq.Sync)
1304 syncReq.Sync = make([]*deploymentspb.SyncDeploymentVersionUserDataRequest_SyncUserData, 0) // reset the syncReq.Sync slice for the next batch
1305 }
1306 }
1307 > if len(syncReq.Sync) > 0 { version_workflow.go
1308 > batches = append(batches, syncReq.Sync)
1309 > }
1310
1311 // calling SyncDeploymentVersionUserData for each batch
1312 > for _, batch := range batches { version_workflow.go
1313 > activityCtx := workflow.WithActivityOptions(ctx, defaultActivityOptions)
1314 > var syncRes deploymentspb.SyncDeploymentVersionUserDataResponse
1315 >
1316 > err := workflow.ExecuteActivity(activityCtx, d.a.SyncDeploymentVersionUserData, &deploymentspb.SyncDeploymentVersionUserDataRequest{
1317 > Version: state.GetVersion(),
1318 > Sync: batch,
1319 > }).Get(ctx, &syncRes)
1320 > if err != nil {
1321 return err
1322 }
1323 > if len(syncRes.TaskQueueMaxVersions) > 0 { version_workflow.go
1324 > // wait for propagation
1325 > err = workflow.ExecuteActivity(
1326 > activityCtx,
1327 > d.a.CheckWorkerDeploymentUserDataPropagation,
1328 > &deploymentspb.CheckWorkerDeploymentUserDataPropagationRequest{
1329 > TaskQueueMaxVersions: syncRes.TaskQueueMaxVersions,
1330 > }).Get(ctx, nil)
1331 > if err != nil {
1332 return err
1333 }