activities.go ×10

Frontier kind: Code frontier

unlabeled · c_a9a2354f4216

7 tests · 3058 LOC · 140 files · introduces 0 tests · 66 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges66 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
574 ranges3058 lines · 140 files · Browse complete extent
All tests (intent)
7 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.

3 files ranked by introduced lines: 66 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/migration/activities.go 50 introduced LOC · 10 ranges

Open complete file

165 )
166
167 > func (r verifyResult) isVerified() bool { activities.go
168 > return r.status == verified || r.status == skipped
169 > }
170
171 // TODO: CallerTypePreemptablee should be set in activity background context for all migration activities.
846 execution *ExecutionInfo,
847 ns *namespace.Namespace,
848 > ) (verifyResult, error) { activities.go
849 > namespaceID := request.NamespaceID
850 > tags := []tag.Tag{
851 > tag.WorkflowNamespaceID(namespaceID),
852 > tag.WorkflowID(execution.BusinessID),
853 > tag.WorkflowRunID(execution.RunID),
854 > }
855 > resp, err := a.HistoryClient.DescribeMutableState(ctx, &historyservice.DescribeMutableStateRequest{
856 > NamespaceId: namespaceID,
857 > Execution: &commonpb.WorkflowExecution{
858 > WorkflowId: execution.BusinessID,
859 > RunId: execution.RunID,
860 > },
861 > ArchetypeId: execution.ArchetypeID,
862 > SkipForceReload: true,
863 > })
864 > if err != nil {
865 if common.IsNotFoundError(err) {
866 // The outstanding workflow execution may be deleted (due to retention) on source cluster after replication tasks were generated.
880 // Zombie workflow should be a transient state. However, if there is Zombie workflow on the source cluster,
881 // it is skipped to avoid such workflow being processed on the target cluster.
882 > if resp.GetDatabaseMutableState().GetExecutionState().GetState() == enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE { activities.go
883 a.forceReplicationMetricsHandler.WithTags(metrics.NamespaceTag(request.Namespace)).Counter(metrics.EncounterZombieWorkflowCount.Name()).Record(1)
884 a.Logger.Info("createReplicationTasks skip Zombie workflow", tags...)
912 ns *namespace.Namespace,
913 execution *ExecutionInfo,
914 > ) (verifyResult, error) { activities.go
915 > s := time.Now()
916 > // Check if execution exists on remote cluster
917 >
918 > archetype, err := a.archetypeIDToName(ctx, execution.ArchetypeID)
919 > if err != nil {
920 return verifyResult{
921 status: notVerified,
923 }
924
925 > mu, err := remotAdminClient.DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ activities.go
926 > Namespace: request.Namespace,
927 > Execution: &commonpb.WorkflowExecution{
928 > WorkflowId: execution.BusinessID,
929 > RunId: execution.RunID,
930 > },
931 > Archetype: archetype,
932 > ArchetypeId: execution.ArchetypeID,
933 > SkipForceReload: true,
934 > })
935 > a.forceReplicationMetricsHandler.Timer(metrics.VerifyDescribeMutableStateLatency.Name()).Record(time.Since(s))
936 >
937 > switch e := err.(type) {
938 case nil:
939 result, err := a.workflowVerifier(ctx, request, remotAdminClient, a.adminClient, ns, execution, mu)
943 return result, err
944
945 > case *serviceerror.NotFound: activities.go
946 > a.forceReplicationMetricsHandler.WithTags(metrics.NamespaceTag(request.Namespace)).Counter(metrics.VerifyReplicationTaskNotFound.Name()).Record(1)
947 > // Calling checkSkipWorkflowExecution for every NotFound is sub-optimal as most common case to skip is workflow being deleted due to retention.
948 > // A better solution is to only check the existence for workflow which is close to retention period.
949 > return a.checkSkipWorkflowExecution(ctx, request, execution, ns)
950
951 case *serviceerror.NamespaceNotFound:
1249 // TODO: Accept archetypeID in admin apis directly and remove this translation logic which relies on
1250 // chasm registry.
1251 > if archetypeID == chasmactivity.ArchetypeID { activities.go
1252 return chasmactivity.Archetype, nil
1253 }
1254 > if archetypeID == chasmnexus.ArchetypeID { activities.go
1255 return chasmnexus.Archetype, nil
1256 }
1257
1258 > archetype, ok := a.chasmRegistry.ComponentFqnByID(archetypeID) activities.go
1259 > if !ok {
1260 activityInfo := activity.GetInfo(ctx)
1261 err := fmt.Errorf("unknown archetypeID: %v", archetypeID)
1269 return "", err
1270 }
1271 > return archetype, nil activities.go
1272 }
go.temporal.io/server/api/adminservice/v1/request_response.pb.go 8 introduced LOC · 1 range

Open complete file

337 func (*DescribeMutableStateRequest) ProtoMessage() {}
338
339 > func (x *DescribeMutableStateRequest) ProtoReflect() protoreflect.Message { request_response.pb.go
340 > mi := &file_temporal_server_api_adminservice_v1_request_response_proto_msgTypes[4]
341 > if x != nil {
342 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
343 > if ms.LoadMessageInfo() == nil {
344 > ms.StoreMessageInfo(mi)
345 > }
346 > return ms
347 }
348 return mi.MessageOf(x)
go.temporal.io/server/api/adminservicemock/v1/service_grpc.pb.mock.go 8 introduced LOC · 2 ranges

Open complete file

245
246 // DescribeMutableState mocks base method.
247 > func (m *MockAdminServiceClient) DescribeMutableState(ctx context.Context, in *adminservice.DescribeMutableStateRequest, opts ...grpc.CallOption) (*adminservice.DescribeMutableStateResponse, error) { service_grpc.pb.mock.go
248 > m.ctrl.T.Helper()
249 > varargs := []any{ctx, in}
250 > for _, a := range opts {
251 varargs = append(varargs, a)
252 }
253 > ret := m.ctrl.Call(m, "DescribeMutableState", varargs...) service_grpc.pb.mock.go
254 > ret0, _ := ret[0].(*adminservice.DescribeMutableStateResponse)
255 > ret1, _ := ret[1].(error)
256 > return ret0, ret1
257 }
258