version_workflow.go ×7

Frontier kind: Code frontier

unlabeled · c_dfb3771bbef2

28 tests · 2767 LOC · 133 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
423 ranges2767 lines · 133 files · Browse complete extent
All tests (intent)
28 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: 24 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/workerdeployment/version_workflow.go 24 introduced LOC · 7 ranges

Open complete file

506 }
507
508 > func (d *VersionWorkflowRunner) handleDeleteVersion(ctx workflow.Context, args *deploymentspb.DeleteVersionArgs) error { version_workflow.go
509 > if err := d.preUpdateChecks(ctx); err != nil {
510 return err
511 }
512
513 // use lock to enforce only one update at a time
514 > err := d.lock.Lock(ctx) version_workflow.go
515 > if err != nil {
516 d.logger.Error("Could not acquire workflow lock in version workflow", "error", err)
517 return err
518 }
519 // also lock compute config lock to ensure that the compute config is not updated while the version is being deleted.
520 > err = d.computeConfigLock.Lock(ctx) version_workflow.go
521 > if err != nil {
522 d.logger.Error("Could not acquire compute config lock in version workflow", "error", err)
523 return err
524 }
525 > defer func() { version_workflow.go
526 > // although the handler might have not changed the state and had returned an error, still
527 > // it's better to CaN because some history events are built now.
528 > d.setStateChanged()
529 > d.computeConfigLock.Unlock()
530 > d.lock.Unlock()
531 > }()
532
533 > if d.deleteVersion { version_workflow.go
534 // already deleted, returning success so it is idempotent
535 return nil
536 }
537
538 > if !d.hasMinVersion(VersionDataRevisionNumber) { version_workflow.go
539 // wait until deployment workflow started
540 //nolint:staticcheck // SA1019
546 }
547
548 > activityCtx := workflow.WithActivityOptions(ctx, defaultActivityOptions) version_workflow.go
549 >
550 > // Manual deletion of versions is only possible when:
551 > // 1. The version is not current or ramping (checked in the deployment wf)
552 > // 2. The version is not draining. (check skipped when `skip-drainage=true` )
553 > // 3. The version has no active pollers.
554 >
555 > // 2. Check if the version is draining.
556 > if !args.SkipDrainage {
557 if d.GetVersionState().GetDrainageInfo().GetStatus() == enumspb.VERSION_DRAINAGE_STATUS_DRAINING {
558 // activity won't retry on this error since version not eligible for deletion