workflow.go ×5

Frontier kind: Joint frontier

unlabeled · c_e9dcd2466c2e

1 test · 2828 LOC · 137 files · introduces 1 test · 22 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges22 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
422 ranges2828 lines · 137 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.

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

go.temporal.io/server/service/history/ndc/workflow.go 22 introduced LOC · 5 ranges

Open complete file

176
177 if currentCluster == lastWriteCluster {
178 > return historyi.TransactionPolicyActive, r.terminateMutableState(lastWriteVersion, incomingLastWriteVersion) workflow.go
179 > }
180 _, err = r.mutableState.UpdateWorkflowStateStatus(
181 enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
267 lastWriteVersion int64,
268 incomingLastWriteVersion int64,
269 > ) error { workflow.go
270 >
271 > if err := r.mutableState.UpdateCurrentVersion(lastWriteVersion, true); err != nil {
272 return err
273 }
274
275 > if !r.mutableState.IsWorkflow() { workflow.go
276 return r.mutableState.ChasmTree().Terminate(chasm.TerminateComponentRequest{
277 Identity: consts.IdentityHistoryService,
282 }
283
284 > if _, err := r.failWorkflowTask(); err != nil { workflow.go
285 return err
286 }
287
288 // do not persist the change right now, Workflow requires transaction
289 > _, err := r.mutableState.AddWorkflowExecutionTerminatedEvent( workflow.go
290 > common.FailureReasonWorkflowTerminationDueToVersionConflict,
291 > payloads.EncodeString(fmt.Sprintf("terminated by version: %v", incomingLastWriteVersion)),
292 > consts.IdentityHistoryService,
293 > false,
294 > nil, // No links necessary.
295 > )
296 >
297 > // Don't abort updates here for a few reasons:
298 > // 1. There probably no update waiters for Wf which is about to be terminated,
299 > // 2. MS is not persisted yet, and updates should be aborted after MS is persisted, which is not trivial in this case,
300 > // 3. New replication version will force update registry reload and waiters will get errors.
301 > // r.GetContext().UpdateRegistry(context.Background(), nil).Abort(update.AbortReasonWorkflowTerminated)
302 >
303 > return err
304 }
305