mutable_state_impl.go ×10

Frontier kind: Code frontier

unlabeled · c_b1286807060a

2 tests · 5153 LOC · 211 files · introduces 0 tests · 52 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges52 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
850 ranges5153 lines · 211 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: 52 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 48 introduced LOC · 10 ranges

Open complete file

9079 func (ms *MutableStateImpl) ApplyMutation(
9080 mutation *persistencespb.WorkflowMutableStateMutation,
9081 > ) error { mutable_state_impl.go
9082 > prevExecutionInfoSize := ms.executionInfo.Size()
9083 > currentVersionedTransition := ms.CurrentVersionedTransition()
9084 >
9085 > ms.applySignalRequestedIds(mutation.SignalRequestedIds, mutation.ExecutionInfo)
9086 > err := ms.applyTombstones(mutation.SubStateMachineTombstoneBatches, currentVersionedTransition)
9087 > if err != nil {
9088 return err
9089 }
9090 > err = ms.syncExecutionInfo(ms.executionInfo, mutation.ExecutionInfo, false) mutable_state_impl.go
9091 > if err != nil {
9092 return err
9093 }
9094
9095 > ms.applyUpdatesToUpdateInfos(mutation.UpdatedUpdateInfos, false) mutable_state_impl.go
9096 >
9097 > ms.approximateSize += mutation.ExecutionState.Size() - ms.executionState.Size()
9098 > ms.executionState = mutation.ExecutionState
9099 >
9100 > err = ms.applyUpdatesToSubStateMachines(
9101 > mutation.UpdatedActivityInfos,
9102 > mutation.UpdatedTimerInfos,
9103 > mutation.UpdatedChildExecutionInfos,
9104 > mutation.UpdatedRequestCancelInfos,
9105 > mutation.UpdatedSignalInfos,
9106 > false,
9107 > )
9108 > if err != nil {
9109 return err
9110 }
9111
9112 > err = ms.applyUpdatesToStateMachineNodes(mutation.UpdatedSubStateMachines) mutable_state_impl.go
9113 > if err != nil {
9114 return err
9115 }
9116
9117 > ms.approximateSize += ms.executionInfo.Size() - prevExecutionInfoSize mutable_state_impl.go
9118 >
9119 > // approximateSize update will be handled upon closing transaction
9120 > return ms.chasmTree.ApplyMutation(chasm.NodesMutation{
9121 > UpdatedNodes: mutation.UpdatedChasmNodes,
9122 > })
9123 }
9124
9232 func (ms *MutableStateImpl) applyUpdatesToStateMachineNodes(
9233 nodeMutations []*persistencespb.WorkflowMutableStateMutation_StateMachineNodeMutation,
9234 > ) error { mutable_state_impl.go
9235 > root := ms.HSM()
9236 > // Source cluster uses Walk() to generate node mutations.
9237 > // Walk() uses pre-order DFS. Updated parent nodes will be added before children.
9238 > for _, nodeMutation := range nodeMutations {
9239 var internalNode *persistencespb.StateMachineNode
9240 incomingPath := []hsm.Key{}
9470 }
9471 if !isSnapshot {
9472 > ignoreFields = append(ignoreFields, &info.SubStateMachineTombstoneBatches) mutable_state_impl.go
9473 > }
9474 return ignoreFields
9475 }
9517 tombstoneBatches []*persistencespb.StateMachineTombstoneBatch,
9518 currentVersionedTransition *persistencespb.VersionedTransition,
9519 > ) error { mutable_state_impl.go
9520 > var err error
9521 > deletedChasmNodes := make(map[string]struct{})
9522 > for _, tombstoneBatch := range tombstoneBatches {
9523 if transitionhistory.Compare(tombstoneBatch.VersionedTransition, currentVersionedTransition) <= 0 {
9524 continue
9561 ms.totalTombstones += len(tombstoneBatch.StateMachineTombstones)
9562 }
9563 > ms.capTombstoneCount() mutable_state_impl.go
9564 >
9565 > return ms.chasmTree.ApplyMutation(chasm.NodesMutation{
9566 > DeletedNodes: deletedChasmNodes,
9567 > })
9568 }
9569
go.temporal.io/server/service/history/workflow/noop_chasm_tree.go 3 introduced LOC · 1 range

Open complete file

34 }
35
36 > func (*noopChasmTree) ApplyMutation(chasm.NodesMutation) error { noop_chasm_tree.go
37 > return nil
38 > }
39
40 func (*noopChasmTree) ApplySnapshot(chasm.NodesSnapshot) error {
go.temporal.io/server/service/history/ndc/workflow_state_replicator.go 1 introduced LOC · 1 range

Open complete file

566
567 if mutation != nil {
568 > err = localMutableState.ApplyMutation(mutation.StateMutation) workflow_state_replicator.go
569 } else {
570 err = localMutableState.ApplySnapshot(snapshot.State)