mutable_state_impl.go ×9

Frontier kind: Joint frontier

unlabeled · c_e88a00152cdf

2 tests · 5160 LOC · 211 files · introduces 1 test · 48 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges48 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
855 ranges5160 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

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

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 43 introduced LOC · 9 ranges

Open complete file

9125 func (ms *MutableStateImpl) ApplySnapshot(
9126 snapshot *persistencespb.WorkflowMutableState,
9127 > ) error { mutable_state_impl.go
9128 > prevExecutionInfoSize := ms.executionInfo.Size()
9129 >
9130 > ms.applySignalRequestedIds(snapshot.SignalRequestedIds, snapshot.ExecutionInfo)
9131 > err := ms.syncExecutionInfo(ms.executionInfo, snapshot.ExecutionInfo, true)
9132 > if err != nil {
9133 return err
9134 }
9135
9136 > ms.applyUpdatesToUpdateInfos(snapshot.ExecutionInfo.UpdateInfos, true) mutable_state_impl.go
9137 >
9138 > err = ms.syncSubStateMachinesByType(snapshot.ExecutionInfo.SubStateMachinesByType)
9139 > if err != nil {
9140 return err
9141 }
9142
9143 > ms.approximateSize += snapshot.ExecutionState.Size() - ms.executionState.Size() mutable_state_impl.go
9144 > ms.executionState = snapshot.ExecutionState
9145 >
9146 > err = ms.applyUpdatesToSubStateMachines(
9147 > snapshot.ActivityInfos,
9148 > snapshot.TimerInfos,
9149 > snapshot.ChildExecutionInfos,
9150 > snapshot.RequestCancelInfos,
9151 > snapshot.SignalInfos,
9152 > true,
9153 > )
9154 > if err != nil {
9155 return err
9156 }
9157
9158 > ms.approximateSize += ms.executionInfo.Size() - prevExecutionInfoSize mutable_state_impl.go
9159 >
9160 > // approximateSize update will be handled upon closing transaction
9161 > return ms.chasmTree.ApplySnapshot(chasm.NodesSnapshot{
9162 > Nodes: snapshot.ChasmNodes,
9163 > })
9164 }
9165
9325 ) error {
9326 if isSnapshot {
9327 > for key := range pendingInfos { mutable_state_impl.go
9328 if _, ok := updatedSubStateMachine[key]; !ok {
9329 err := deleteFn(key)
9375 }
9376 if isSnapshot {
9377 > for updateID := range ms.executionInfo.UpdateInfos { mutable_state_impl.go
9378 if _, ok := updatedUpdateInfos[updateID]; !ok {
9379 ms.approximateSize -= ms.executionInfo.UpdateInfos[updateID].Size() + len(updateID)
9484 }
9485
9486 > func (ms *MutableStateImpl) syncSubStateMachinesByType(incoming map[string]*persistencespb.StateMachineMap) error { mutable_state_impl.go
9487 > // check if there is node been deleted
9488 > currentHSM := ms.HSM()
9489 > incomingHSM, err := hsm.NewRoot(ms.shard.StateMachineRegistry(), StateMachineType, ms, incoming, ms)
9490 > if err != nil {
9491 return err
9492 }
9493
9494 > if err := incomingHSM.Walk(func(incomingNode *hsm.Node) error { mutable_state_impl.go
9495 > if incomingNode.Parent == nil {
9496 > // skip root which is the entire mutable state
9497 > return nil
9498 > }
9499 incomingNodePath := incomingNode.Path()
9500 _, err := currentHSM.Child(incomingNodePath)
9508 }
9509
9510 > ms.executionInfo.SubStateMachinesByType = incoming mutable_state_impl.go
9511 > ms.mustInitHSM()
9512 > return nil
9513 }
9514
go.temporal.io/server/service/history/workflow/noop_chasm_tree.go 3 introduced LOC · 1 range

Open complete file

38 }
39
40 > func (*noopChasmTree) ApplySnapshot(chasm.NodesSnapshot) error { noop_chasm_tree.go
41 > return nil
42 > }
43
44 func (*noopChasmTree) RefreshTasks() error {
go.temporal.io/server/service/history/ndc/workflow_state_replicator.go 2 introduced LOC · 1 range

Open complete file

568 err = localMutableState.ApplyMutation(mutation.StateMutation)
569 } else {
570 > err = localMutableState.ApplySnapshot(snapshot.State) workflow_state_replicator.go
571 > }
572 if err != nil {
573 return false, err