execution_manager.go ×6

Frontier kind: Code frontier

unlabeled · c_05b07b383e3a

312 tests · 3487 LOC · 160 files · introduces 0 tests · 136 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges136 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
599 ranges3487 lines · 160 files · Browse complete extent
All tests (intent)
312 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.

2 files ranked by introduced lines: 136 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/size.go 91 introduced LOC · 2 ranges

Open complete file

223 counts := make(map[string]int)
224 for category, tasks := range *t {
225 > counts[category.Name()] = len(tasks) size.go
226 > }
227 return counts
228 }
236 }
237
238 > executionInfoSize := sizeOfBlob(snapshot.ExecutionInfoBlob) size.go
239 > executionStateSize := sizeOfBlob(snapshot.ExecutionStateBlob)
240 >
241 > totalActivityCount := snapshot.ExecutionInfo.ActivityCount
242 > activityInfoCount := len(snapshot.ActivityInfos)
243 > activityInfoSize := sizeOfInt64BlobMap(snapshot.ActivityInfos)
244 >
245 > totalUserTimerCount := snapshot.ExecutionInfo.UserTimerCount
246 > timerInfoCount := len(snapshot.TimerInfos)
247 > timerInfoSize := sizeOfStringBlobMap(snapshot.TimerInfos)
248 >
249 > totalChildExecutionCount := snapshot.ExecutionInfo.ChildExecutionCount
250 > childExecutionInfoCount := len(snapshot.ChildExecutionInfos)
251 > childExecutionInfoSize := sizeOfInt64BlobMap(snapshot.ChildExecutionInfos)
252 >
253 > totalRequestCancelExternalCount := snapshot.ExecutionInfo.RequestCancelExternalCount
254 > requestCancelInfoCount := len(snapshot.RequestCancelInfos)
255 > requestCancelInfoSize := sizeOfInt64BlobMap(snapshot.RequestCancelInfos)
256 >
257 > totalSignalExternalCount := snapshot.ExecutionInfo.SignalExternalCount
258 > signalInfoCount := len(snapshot.SignalInfos)
259 > signalInfoSize := sizeOfInt64BlobMap(snapshot.SignalInfos)
260 >
261 > totalSignalCount := snapshot.ExecutionInfo.SignalCount
262 > signalRequestIDCount := len(snapshot.SignalRequestedIDs)
263 > signalRequestIDSize := sizeOfStringSet(snapshot.SignalRequestedIDs)
264 >
265 > totalUpdateCount := snapshot.ExecutionInfo.UpdateCount
266 > updateInfoCount := len(snapshot.ExecutionInfo.UpdateInfos)
267 >
268 > bufferedEventsCount := 0
269 > bufferedEventsSize := 0
270 >
271 > chasmTotalSize := sizeOfChasmNodeMap(snapshot.ChasmNodes)
272 >
273 > totalSize := executionInfoSize
274 > totalSize += executionStateSize
275 > totalSize += activityInfoSize
276 > totalSize += timerInfoSize
277 > totalSize += childExecutionInfoSize
278 > totalSize += requestCancelInfoSize
279 > totalSize += signalInfoSize
280 > totalSize += signalRequestIDSize
281 > totalSize += bufferedEventsSize
282 > totalSize += chasmTotalSize
283 >
284 > taskCountByCategory := taskCountsByCategory(&snapshot.Tasks)
285 >
286 > return &MutableStateStatistics{
287 > TotalSize: totalSize,
288 > HistoryStatistics: historyStatistics,
289 >
290 > ExecutionInfoSize: executionInfoSize,
291 > ExecutionStateSize: executionStateSize,
292 >
293 > ActivityInfoSize: activityInfoSize,
294 > ActivityInfoCount: activityInfoCount,
295 > TotalActivityCount: totalActivityCount,
296 >
297 > TimerInfoSize: timerInfoSize,
298 > TimerInfoCount: timerInfoCount,
299 > TotalUserTimerCount: totalUserTimerCount,
300 >
301 > ChildInfoSize: childExecutionInfoSize,
302 > ChildInfoCount: childExecutionInfoCount,
303 > TotalChildExecutionCount: totalChildExecutionCount,
304 >
305 > RequestCancelInfoSize: requestCancelInfoSize,
306 > RequestCancelInfoCount: requestCancelInfoCount,
307 > TotalRequestCancelExternalCount: totalRequestCancelExternalCount,
308 >
309 > SignalInfoSize: signalInfoSize,
310 > SignalInfoCount: signalInfoCount,
311 > TotalSignalExternalCount: totalSignalExternalCount,
312 >
313 > SignalRequestIDSize: signalRequestIDSize,
314 > SignalRequestIDCount: signalRequestIDCount,
315 > TotalSignalCount: totalSignalCount,
316 >
317 > BufferedEventsSize: bufferedEventsSize,
318 > BufferedEventsCount: bufferedEventsCount,
319 >
320 > TaskCountByCategory: taskCountByCategory,
321 >
322 > TotalUpdateCount: totalUpdateCount,
323 > UpdateInfoCount: updateInfoCount,
324 >
325 > ChasmTotalSize: chasmTotalSize,
326 > }
327 }
go.temporal.io/server/common/persistence/execution_manager.go 45 introduced LOC · 6 ranges

Open complete file

106 ctx context.Context,
107 request *CreateWorkflowExecutionRequest,
108 > ) (_ *CreateWorkflowExecutionResponse, retErr error) { execution_manager.go
109 >
110 > var rollback historySizeRollback
111 > defer rollback.revertOnError(&retErr)
112 >
113 > newSnapshot := request.NewWorkflowSnapshot
114 > newWorkflowXDCKVs, newWorkflowNewEvents, newHistoryDiff, err := m.serializeWorkflowEventBatches(
115 > ctx,
116 > request.ShardID,
117 > request.NewWorkflowSnapshot.ExecutionInfo,
118 > request.NewWorkflowEvents,
119 > )
120 > if err != nil {
121 return nil, err
122 }
123
124 > rollback.add(newSnapshot.ExecutionInfo.ExecutionStats, newHistoryDiff.SizeDiff) execution_manager.go
125 >
126 > if err := ValidateCreateWorkflowModeState(
127 > request.Mode,
128 > newSnapshot,
129 > ); err != nil {
130 return nil, err
131 }
132 > if err := ValidateCreateWorkflowStateStatus( execution_manager.go
133 > newSnapshot.ExecutionState.State,
134 > newSnapshot.ExecutionState.Status,
135 > ); err != nil {
136 return nil, err
137 }
138
139 > serializedNewWorkflowSnapshot, err := m.SerializeWorkflowSnapshot(&newSnapshot) execution_manager.go
140 > if err != nil {
141 return nil, err
142 }
143
144 > archetypeID, _ := m.assertAndConvertArchetypeID(request.ArchetypeID, "CreateWorkflowExecution") execution_manager.go
145 > newRequest := &InternalCreateWorkflowExecutionRequest{
146 > ShardID: request.ShardID,
147 > RangeID: request.RangeID,
148 > Mode: request.Mode,
149 > PreviousRunID: request.PreviousRunID,
150 > PreviousLastWriteVersion: request.PreviousLastWriteVersion,
151 > ArchetypeID: archetypeID,
152 > NewWorkflowSnapshot: *serializedNewWorkflowSnapshot,
153 > NewWorkflowNewEvents: newWorkflowNewEvents,
154 > }
155 >
156 > if _, err := m.persistence.CreateWorkflowExecution(ctx, newRequest); err != nil {
157 return nil, err
158 }
159 > m.addXDCCacheKV(newWorkflowXDCKVs) execution_manager.go
160 > return &CreateWorkflowExecutionResponse{
161 > NewMutableStateStats: *statusOfInternalWorkflowSnapshot(
162 > serializedNewWorkflowSnapshot,
163 > newHistoryDiff,
164 > ),
165 > }, nil
166 }
167