mutable_state_impl.go ×8

Frontier kind: Code frontier

unlabeled · c_a37c1bd37d6c

272 tests · 4040 LOC · 164 files · introduces 0 tests · 63 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges63 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
636 ranges4040 lines · 164 files · Browse complete extent
All tests (intent)
272 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: 63 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/mutable_state_impl.go 63 introduced LOC · 8 ranges

Open complete file

7699 // cluster — standby (passive) replays events that were already stamped by
7700 // the active side, and we must not overwrite those principals.
7701 > if transactionPolicy == historyi.TransactionPolicyActive { mutable_state_impl.go
7702 principal := headers.GetPrincipal(ctx)
7703 for _, we := range workflowEventsSeq {
7719 // CloseTransaction() on chasmTree may update execution state & status,
7720 // so must be called before closeTransactionUpdateTransitionHistory().
7721 > chasmNodesMutation, err := ms.chasmTree.CloseTransaction() mutable_state_impl.go
7722 > if err != nil {
7723 return closeTransactionResult{}, err
7724 }
7725
7726 > if ms.closeTransactionShouldSkipPersistence(isStateDirty, chasmNodesMutation) { mutable_state_impl.go
7727 return closeTransactionResult{
7728 skipPersistence: true,
7792 }
7793
7794 > func (ms *MutableStateImpl) closeTransactionShouldSkipPersistence(isStateDirty bool, chasmNodesMutation chasm.NodesMutation) bool { mutable_state_impl.go
7795 > return !ms.IsWorkflow() && !isStateDirty && chasmNodesMutation.IsEmpty()
7796 > }
7797
7798 func (ms *MutableStateImpl) closeTransactionHandleWorkflowTask(
8348 }
8349
8350 > func (ms *MutableStateImpl) cleanupTransaction() error { mutable_state_impl.go
8351 > ms.updateActivityInfos = make(map[int64]*persistencespb.ActivityInfo)
8352 > ms.deleteActivityInfos = make(map[int64]struct{})
8353 > ms.syncActivityTasks = make(map[int64]struct{})
8354 >
8355 > ms.updateTimerInfos = make(map[string]*persistencespb.TimerInfo)
8356 > ms.deleteTimerInfos = make(map[string]struct{})
8357 >
8358 > ms.updateChildExecutionInfos = make(map[int64]*persistencespb.ChildExecutionInfo)
8359 > ms.deleteChildExecutionInfos = make(map[int64]struct{})
8360 >
8361 > ms.updateRequestCancelInfos = make(map[int64]*persistencespb.RequestCancelInfo)
8362 > ms.deleteRequestCancelInfos = make(map[int64]struct{})
8363 >
8364 > ms.updateSignalInfos = make(map[int64]*persistencespb.SignalInfo)
8365 > ms.deleteSignalInfos = make(map[int64]struct{})
8366 >
8367 > ms.updateSignalRequestedIDs = make(map[string]struct{})
8368 > ms.deleteSignalRequestedIDs = make(map[string]struct{})
8369 >
8370 > ms.visibilityUpdated = false
8371 > ms.executionStateUpdated = false
8372 > ms.workflowTaskUpdated = false
8373 > ms.isResetStateUpdated = false
8374 > ms.timeSkippingInfoUpdated = false
8375 > ms.updateInfoUpdated = make(map[string]struct{})
8376 > ms.timerInfosUserDataUpdated = make(map[string]struct{})
8377 > ms.activityInfosUserDataUpdated = make(map[int64]struct{})
8378 > ms.reapplyEventsCandidate = nil
8379 > ms.subStateMachineDeleted = false
8380 > ms.replayEventBatchID = common.EmptyEventID
8381 >
8382 > ms.stateInDB = ms.executionState.State
8383 > ms.nextEventIDInDB = ms.GetNextEventID()
8384 > if len(ms.executionInfo.TransitionHistory) != 0 {
8385 ms.versionedTransitionInDB = ms.CurrentVersionedTransition()
8386 > } else { mutable_state_impl.go
8387 ms.versionedTransitionInDB = nil
8388 }
8389 // ms.dbRecordVersion remains the same
8390
8391 > ms.hBuilder = historybuilder.New( mutable_state_impl.go
8392 > ms.timeSource,
8393 > ms.shard.GenerateTaskIDs,
8394 > ms.GetCurrentVersion(),
8395 > ms.nextEventIDInDB,
8396 > ms.bufferEventsInDB,
8397 > ms.metricsHandler,
8398 > ms.config.MaximumEventBatchSizeInBytes,
8399 > )
8400 >
8401 > ms.InsertTasks = make(map[tasks.Category][]tasks.Task)
8402 > ms.BestEffortDeleteTasks = make(map[tasks.Category][]tasks.Key)
8403 >
8404 > // Clear outputs for the next transaction.
8405 > ms.stateMachineNode.ClearTransactionState()
8406 > // Clear out transient state machine state.
8407 > ms.currentTransactionAddedStateMachineEventTypes = nil
8408 >
8409 > return nil
8410 }
8411
8477 }
8478
8479 > return workflowEventsSeq, newEventsBatches, newBufferBatch, clearBuffer, nil mutable_state_impl.go
8480 }
8481