chasm_engine.go ×5

Frontier kind: Code frontier

unlabeled · c_988aa3d33498

2 tests · 8187 LOC · 247 files · introduces 0 tests · 30 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges30 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1808 ranges8187 lines · 247 files · Browse complete extent
All tests (intent)
2 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.

3 files ranked by introduced lines: 30 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/chasm_engine.go 13 introduced LOC · 5 ranges

Open complete file

582
583 if mutableState.IsWorkflowExecutionRunning() {
584 > ns, err := shardContext.GetNamespaceRegistry().GetNamespaceByID(namespace.ID(ref.NamespaceID)) chasm_engine.go
585 > if err != nil {
586 return err
587 }
588 > if ns.ActiveClusterName(namespace.RoutingKey{ID: ref.BusinessID}) == shardContext.GetClusterMetadata().GetCurrentClusterName() { chasm_engine.go
589 > chasmTree, ok := mutableState.ChasmTree().(*chasm.Node)
590 > if !ok {
591 return serviceerror.NewInternalf(
592 "CHASM tree implementation not properly wired up, encountered type: %T, expected type: %T",
596 }
597
598 > chasmTree.SetDeleteAfterClose(true) chasm_engine.go
599 > if err := chasmTree.Terminate(request.TerminateComponentRequest); err != nil {
600 return err
601 }
602
603 > taskGenerator := workflow.GetTaskGeneratorProvider().NewTaskGenerator(shardContext, mutableState) chasm_engine.go
604 > deleteTask, err := taskGenerator.GenerateDeleteExecutionTask()
605 > if err != nil {
606 return err
607 }
608 > mutableState.AddTasks(deleteTask) chasm_engine.go
609 >
610 > return executionLease.GetContext().UpdateWorkflowExecutionAsActive(ctx, shardContext)
611 }
612 }
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 12 introduced LOC · 3 ranges

Open complete file

1271 }
1272
1273 > if ms.transitionHistoryEnabled { mutable_state_impl.go
1274 > if ms.executionStateUpdated {
1275 > // closing in the current transaction
1276 > return ms.GetCurrentVersion(), nil
1277 > }
1278
1279 // once the mutable state is closed, the execution state will no longer be updated.
8220 // but state in DB is not completed, i.e. completing in this transaction.
8221
8222 > if transactionPolicy == historyi.TransactionPolicyActive { mutable_state_impl.go
8223 > // TODO: consider setting CloseTime in ChasmTree closeTransaction() instead of here.
8224 > ms.executionInfo.CloseTime = timestamppb.New(ms.timeSource.Now())
8225 >
8226 > // If passive cluster, the CloseTime field should already be populated by the replication stack.
8227 > }
8228
8229 > return ms.taskGenerator.GenerateDeleteHistoryEventTask(ms.executionInfo.CloseTime.AsTime()) mutable_state_impl.go
8230 }
8231
go.temporal.io/server/chasm/tree.go 5 introduced LOC · 2 ranges

Open complete file

1847 ) error {
1848 if n.deleteAfterClose {
1849 > return nil tree.go
1850 > }
1851
1852 if !rootLifecycleChanged &&
3110 // SetDeleteAfterClose suppresses the close visibility task when an execution is being
3111 // terminated as part of a delete operation. Must be called before a [Terminate] call, like in DeleteExecution.
3112 > func (n *Node) SetDeleteAfterClose(deleteAfterClose bool) { tree.go
3113 > n.deleteAfterClose = deleteAfterClose
3114 > }
3115
3116 // ArchetypeID returns the framework's internal ID for the root component's fully qualified name.