transaction_manager_existing_workflow.go ×5

Frontier kind: Joint frontier

unlabeled · c_0640ddc252c9

1 test · 2776 LOC · 141 files · introduces 1 test · 45 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges45 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
414 ranges2776 lines · 141 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

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

go.temporal.io/server/service/history/ndc/transaction_manager_existing_workflow.go 35 introduced LOC · 5 ranges

Open complete file

67 // check whether target workflow is current workflow by calling DB API
68 if !isWorkflowRebuilt && mutableState.IsCurrentWorkflowGuaranteed() {
69 > // NOTE: if target workflow is rebuilt, then IsCurrentWorkflowGuaranteed is not trustworthy transaction_manager_existing_workflow.go
70 >
71 > // update to current record, since target workflow is pointed by current record
72 > return r.dispatchWorkflowUpdateAsCurrent(
73 > ctx,
74 > isWorkflowRebuilt,
75 > targetWorkflow,
76 > newWorkflow,
77 > archetypeID,
78 > )
79 > }
80
81 targetExecutionInfo := mutableState.GetExecutionInfo()
182
183 if !isWorkflowRebuilt {
184 > return r.executeTransaction( transaction_manager_existing_workflow.go
185 > ctx,
186 > nDCTransactionPolicyUpdateAsCurrent,
187 > nil,
188 > targetWorkflow,
189 > newWorkflow,
190 > archetypeID,
191 > )
192 > }
193
194 return r.executeTransaction(
236 targetWorkflow Workflow,
237 newWorkflow Workflow,
239 >
240 > if newWorkflow == nil {
241 return targetWorkflow.GetContext().UpdateWorkflowExecutionAsPassive(ctx, r.shardContext)
242 }
243
244 > return targetWorkflow.GetContext().UpdateWorkflowExecutionWithNewAsPassive( transaction_manager_existing_workflow.go
245 > ctx,
246 > r.shardContext,
247 > newWorkflow.GetContext(),
248 > newWorkflow.GetMutableState(),
249 > )
250 }
251
522
523 switch transactionPolicy {
524 > case nDCTransactionPolicyUpdateAsCurrent: transaction_manager_existing_workflow.go
525 > return r.updateAsCurrent(
526 > ctx,
527 > targetWorkflow,
528 > newWorkflow,
529 > )
530
531 case nDCTransactionPolicyUpdateAsZombie:
go.temporal.io/server/service/history/interfaces/workflow_context_mock.go 10 introduced LOC · 2 ranges

Open complete file

363
364 // UpdateWorkflowExecutionWithNewAsPassive mocks base method.
365 > func (m *MockWorkflowContext) UpdateWorkflowExecutionWithNewAsPassive(ctx context.Context, shardContext ShardContext, newContext WorkflowContext, newMutableState MutableState) error { workflow_context_mock.go
366 > m.ctrl.T.Helper()
367 > ret := m.ctrl.Call(m, "UpdateWorkflowExecutionWithNewAsPassive", ctx, shardContext, newContext, newMutableState)
368 > ret0, _ := ret[0].(error)
369 > return ret0
370 > }
371
372 // UpdateWorkflowExecutionWithNewAsPassive indicates an expected call of UpdateWorkflowExecutionWithNewAsPassive.
373 > func (mr *MockWorkflowContextMockRecorder) UpdateWorkflowExecutionWithNewAsPassive(ctx, shardContext, newContext, newMutableState any) *gomock.Call { workflow_context_mock.go
374 > mr.mock.ctrl.T.Helper()
375 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowExecutionWithNewAsPassive", reflect.TypeOf((*MockWorkflowContext)(nil).UpdateWorkflowExecutionWithNewAsPassive), ctx, shardContext, newContext, newMutableState)
376 > }