workflow_resetter.go ×5

Frontier kind: Code frontier

unlabeled · c_45a63ee40b32

5 tests · 4299 LOC · 192 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
635 ranges4299 lines · 192 files · Browse complete extent
All tests (intent)
5 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.

1 file ranked by introduced lines: 41 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/ndc/workflow_resetter.go 41 introduced LOC · 5 ranges

Open complete file

848 allowResetWithPendingChildren bool,
849 childrenInitializedAfterReset map[string]*persistencespb.ResetChildInfo,
850 > ) (string, error) { workflow_resetter.go
851 >
852 > // TODO change this logic to fetching all workflow [baseWorkflow, currentWorkflow]
853 > // from visibility for better coverage of events eligible for re-application.
854 > // after the above change, this API do not have to return the continue as new run ID
855 >
856 > iter := collection.NewPagingIterator(r.getPaginationFn(
857 > ctx,
858 > firstEventID,
859 > nextEventID,
860 > branchToken,
861 > ))
862 >
863 > var nextRunID string
864 > var lastEvents []*historypb.HistoryEvent
865 >
866 > for iter.HasNext() {
867 > batch, err := iter.Next()
868 > if err != nil {
869 return "", err
870 }
871 > lastEvents = batch.Events workflow_resetter.go
872 > if _, err := r.reapplyEvents(ctx, mutableState, lastEvents, resetReapplyExcludeTypes); err != nil {
873 return "", err
874 }
893 }
894
895 > if len(lastEvents) > 0 { workflow_resetter.go
896 > lastEvent := lastEvents[len(lastEvents)-1]
897 > if lastEvent.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW {
898 nextRunID = lastEvent.GetWorkflowExecutionContinuedAsNewEventAttributes().GetNewExecutionRunId()
899 }
900 }
901 > return nextRunID, nil workflow_resetter.go
902 }
903
907 events []*historypb.HistoryEvent,
908 resetReapplyExcludeTypes map[enumspb.ResetReapplyExcludeType]struct{},
909 > ) ([]*historypb.HistoryEvent, error) { workflow_resetter.go
910 > // When reapplying events during WorkflowReset, we do not check for conflicting update IDs (they are not possible,
911 > // since the workflow was in a consistent state before reset), and we do not perform deduplication (because we never
912 > // did, before the refactoring that unified two code paths; see comment below.)
913 > return reapplyEvents(
914 > ctx,
915 > mutableState,
916 > nil,
917 > r.shardContext.StateMachineRegistry(),
918 > r.shardContext.ChasmWorkflowRegistry(),
919 > events,
920 > resetReapplyExcludeTypes,
921 > "",
922 > true,
923 > )
924 > }
925
926 func reapplyEvents(