workflow_resetter.go ×4

Frontier kind: Joint frontier

unlabeled · c_5a38a5d703a3

1 test · 4238 LOC · 191 files · introduces 1 test · 44 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges44 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
613 ranges4238 lines · 191 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: 44 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/ndc/workflow_resetter.go 33 introduced LOC · 4 ranges

Open complete file

379 currentExecutionMissing := currentWorkflow == nil
380 if currentExecutionMissing {
381 > // There is no current_executions row (the current run was deleted), so the base->reset link workflow_resetter.go
382 > // and the new current run cannot be committed atomically: re-establishing a missing current
383 > // requires a brand-new insert, while the base run needs a bypass-current update, and no
384 > // single Transaction method does both. Write base-first so retries are safe: if the create
385 > // fails, a retry rewrites the base link and the brand-new insert still succeeds. Creating
386 > // first would leave the reset run as current and permanently conflict with the create.
387 > baseWorkflowMutation, baseWorkflowEventsSeq, err := baseWorkflow.GetMutableState().CloseTransactionAsMutation(
388 > ctx,
389 > historyi.TransactionPolicyActive,
390 > )
391 > if err != nil {
392 return err
393 }
394 > if _, _, err := r.transaction.UpdateWorkflowExecution( workflow_resetter.go
395 > ctx,
396 > persistence.UpdateWorkflowModeBypassCurrent,
397 > chasm.WorkflowArchetypeID,
398 > baseWorkflow.GetMutableState().GetCurrentVersion(),
399 > baseWorkflowMutation,
400 > baseWorkflowEventsSeq,
401 > nil,
402 > nil,
403 > nil,
404 > baseWorkflow.GetMutableState().IsWorkflow(),
405 > ); err != nil {
406 return err
407 }
408 > if _, err := r.transaction.CreateWorkflowExecution( workflow_resetter.go
409 > ctx,
410 > persistence.CreateWorkflowModeBrandNew,
411 > chasm.WorkflowArchetypeID,
412 > resetWorkflow.GetMutableState().GetCurrentVersion(),
413 > resetWorkflowSnapshot,
414 > resetWorkflowEventsSeq,
415 > resetWorkflow.GetMutableState().IsWorkflow(),
416 > ); err != nil {
417 return err
418 }
419 > return nil workflow_resetter.go
420 }
421
go.temporal.io/server/service/history/workflow/transaction_mock.go 11 introduced LOC · 2 ranges

Open complete file

61
62 // CreateWorkflowExecution mocks base method.
63 > func (m *MockTransaction) CreateWorkflowExecution(ctx context.Context, createMode persistence.CreateWorkflowMode, archetypeID chasm.ArchetypeID, newWorkflowFailoverVersion int64, newWorkflowSnapshot *persistence.WorkflowSnapshot, newWorkflowEventsSeq []*persistence.WorkflowEvents, isWorkflow bool) (int64, error) { transaction_mock.go
64 > m.ctrl.T.Helper()
65 > ret := m.ctrl.Call(m, "CreateWorkflowExecution", ctx, createMode, archetypeID, newWorkflowFailoverVersion, newWorkflowSnapshot, newWorkflowEventsSeq, isWorkflow)
66 > ret0, _ := ret[0].(int64)
67 > ret1, _ := ret[1].(error)
68 > return ret0, ret1
69 > }
70
71 // CreateWorkflowExecution indicates an expected call of CreateWorkflowExecution.
72 > func (mr *MockTransactionMockRecorder) CreateWorkflowExecution(ctx, createMode, archetypeID, newWorkflowFailoverVersion, newWorkflowSnapshot, newWorkflowEventsSeq, isWorkflow any) *gomock.Call { transaction_mock.go
73 > mr.mock.ctrl.T.Helper()
74 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkflowExecution", reflect.TypeOf((*MockTransaction)(nil).CreateWorkflowExecution), ctx, createMode, archetypeID, newWorkflowFailoverVersion, newWorkflowSnapshot, newWorkflowEventsSeq, isWorkflow)
75 > }
76
77 // SetWorkflowExecution mocks base method.