task_executor.go ×4

Frontier kind: Code frontier

unlabeled · c_8f06ecfdf4e4

2 tests · 4211 LOC · 186 files · introduces 0 tests · 48 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges48 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
618 ranges4211 lines · 186 files · Browse complete extent
All tests (intent)
2 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.

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

go.temporal.io/server/service/history/replication/task_executor.go 35 introduced LOC · 4 ranges

Open complete file

90 case enumsspb.REPLICATION_TASK_TYPE_HISTORY_METADATA_TASK:
91 // Without kafka we should not have size limits so we don't necessary need this in the new replication scheme.
92 > case enumsspb.REPLICATION_TASK_TYPE_HISTORY_V2_TASK: task_executor.go
93 > err = e.handleHistoryReplicationTask(ctx, replicationTask, forceApply)
94 case enumsspb.REPLICATION_TASK_TYPE_SYNC_WORKFLOW_STATE_TASK:
95 err = e.handleSyncWorkflowStateTask(ctx, replicationTask, forceApply)
209 task *replicationspb.ReplicationTask,
210 forceApply bool,
211 > ) error { task_executor.go
212 >
213 > attr := task.GetHistoryTaskAttributes()
214 > doContinue, err := e.filterTask(namespace.ID(attr.GetNamespaceId()), attr.WorkflowId, forceApply)
215 > if err != nil || !doContinue {
216 return err
217 }
218
219 > startTime := time.Now().UTC() task_executor.go
220 > defer func() {
221 > metrics.ServiceLatency.With(e.metricsHandler).Record(
222 > time.Since(startTime),
223 > metrics.OperationTag(metrics.HistoryReplicationTaskScope),
224 > metrics.NamespaceTag(attr.GetNamespaceId()),
225 > )
226 > }()
227
228 > request := &historyservice.ReplicateEventsV2Request{ task_executor.go
229 > NamespaceId: attr.NamespaceId,
230 > WorkflowExecution: &commonpb.WorkflowExecution{
231 > WorkflowId: attr.WorkflowId,
232 > RunId: attr.RunId,
233 > },
234 > VersionHistoryItems: attr.VersionHistoryItems,
235 > Events: attr.Events,
236 > // new run events does not need version history since there is no prior events
237 > NewRunEvents: attr.NewRunEvents,
238 > NewRunId: attr.NewRunId,
239 > }
240 > namespaceName, _ := e.namespaceRegistry.GetNamespaceName(namespace.ID(attr.NamespaceId))
241 > ctx, cancel := e.newTaskContext(ctx, namespaceName)
242 > defer cancel()
243 >
244 > // This might be extra cost if the workflow belongs to local shard.
245 > // Add a wrapper of the history client to call history engine directly if it becomes an issue.
246 > _, err = e.shardContext.GetHistoryClient().ReplicateEventsV2(ctx, request)
247 > switch retryErr := err.(type) {
248 case nil:
249 return nil
go.temporal.io/server/api/historyservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

1025
1026 // ReplicateEventsV2 mocks base method.
1027 > func (m *MockHistoryServiceClient) ReplicateEventsV2(ctx context.Context, in *historyservice.ReplicateEventsV2Request, opts ...grpc.CallOption) (*historyservice.ReplicateEventsV2Response, error) { service_grpc.pb.mock.go
1028 > m.ctrl.T.Helper()
1029 > varargs := []any{ctx, in}
1030 > for _, a := range opts {
1031 varargs = append(varargs, a)
1032 }
1033 > ret := m.ctrl.Call(m, "ReplicateEventsV2", varargs...) service_grpc.pb.mock.go
1034 > ret0, _ := ret[0].(*historyservice.ReplicateEventsV2Response)
1035 > ret1, _ := ret[1].(error)
1036 > return ret0, ret1
1037 }
1038
1039 // ReplicateEventsV2 indicates an expected call of ReplicateEventsV2.
1040 > func (mr *MockHistoryServiceClientMockRecorder) ReplicateEventsV2(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
1041 > mr.mock.ctrl.T.Helper()
1042 > varargs := append([]any{ctx, in}, opts...)
1043 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReplicateEventsV2", reflect.TypeOf((*MockHistoryServiceClient)(nil).ReplicateEventsV2), varargs...)
1044 > }
1045
1046 // ReplicateWorkflowState mocks base method.