9125
func (ms *MutableStateImpl) ApplySnapshot(
9126
snapshot *persistencespb.WorkflowMutableState,
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
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
9159
>
9160
>
// approximateSize update will be handled upon closing transaction
9161
>
return ms.chasmTree.ApplySnapshot(chasm.NodesSnapshot{
9162
>
Nodes: snapshot.ChasmNodes,
9163
>
})
9164
}
9165