scavenger.go ×5

Frontier kind: Joint frontier

unlabeled · c_15b295a9f79f

1 test · 2655 LOC · 102 files · introduces 1 test · 45 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges45 lines · 4 files
Tests
1 test

Contains — complete concept membership

All code (extent)
520 ranges2655 lines · 102 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.

4 files ranked by introduced lines: 45 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/scanner/history/scavenger.go 23 introduced LOC · 5 ranges

Open complete file

336 }
337
338 > executionInfo := mutableState.GetExecutionInfo() scavenger.go
339 > ns, err := s.registry.GetNamespaceByID(namespace.ID(executionInfo.GetNamespaceId()))
340 > switch err.(type) {
341 case *serviceerror.NamespaceNotFound:
342 // TODO delete the workflow data after issue #3536 close
343 return nil
344 > case nil: scavenger.go
345 // continue to delete
346 default:
348 }
349
350 > retention := ns.Retention() scavenger.go
351 > finalUpdateTime := executionInfo.GetLastUpdateTime()
352 > age := time.Now().UTC().Sub(timestamp.TimeValue(finalUpdateTime))
353 > if age > retention+s.executionDataDurationBuffer() {
354 > _, err = s.adminClient.DeleteWorkflowExecution(ctx, &adminservice.DeleteWorkflowExecutionRequest{
355 > Namespace: ns.Name().String(),
356 > Execution: &commonpb.WorkflowExecution{
357 > WorkflowId: executionInfo.GetWorkflowId(),
358 > RunId: mutableState.GetExecutionState().GetRunId(),
359 > },
360 > Archetype: chasm.WorkflowArchetype,
361 > })
362 > if err != nil {
363 // This is experimental. Ignoring the error so it will not block the history scavenger.
364 s.logger.Warn("Failed to delete workflow past retention in history scavenger",
370 return nil
371 }
372 > s.logger.Info("Delete workflow data past retention via history scavenger", scavenger.go
373 > tag.WorkflowNamespace(ns.Name().String()),
374 > tag.WorkflowID(executionInfo.GetWorkflowId()),
375 > tag.WorkflowRunID(mutableState.GetExecutionState().GetRunId()),
376 > )
377 }
378 > return nil scavenger.go
379 }
380
go.temporal.io/server/api/adminservicemock/v1/service_grpc.pb.mock.go 13 introduced LOC · 3 ranges

Open complete file

165
166 // DeleteWorkflowExecution mocks base method.
167 > func (m *MockAdminServiceClient) DeleteWorkflowExecution(ctx context.Context, in *adminservice.DeleteWorkflowExecutionRequest, opts ...grpc.CallOption) (*adminservice.DeleteWorkflowExecutionResponse, error) { service_grpc.pb.mock.go
168 > m.ctrl.T.Helper()
169 > varargs := []any{ctx, in}
170 > for _, a := range opts {
171 varargs = append(varargs, a)
172 }
173 > ret := m.ctrl.Call(m, "DeleteWorkflowExecution", varargs...) service_grpc.pb.mock.go
174 > ret0, _ := ret[0].(*adminservice.DeleteWorkflowExecutionResponse)
175 > ret1, _ := ret[1].(error)
176 > return ret0, ret1
177 }
178
179 // DeleteWorkflowExecution indicates an expected call of DeleteWorkflowExecution.
180 > func (mr *MockAdminServiceClientMockRecorder) DeleteWorkflowExecution(ctx, in any, opts ...any) *gomock.Call { service_grpc.pb.mock.go
181 > mr.mock.ctrl.T.Helper()
182 > varargs := append([]any{ctx, in}, opts...)
183 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkflowExecution", reflect.TypeOf((*MockAdminServiceClient)(nil).DeleteWorkflowExecution), varargs...)
184 > }
185
186 // DescribeCluster mocks base method.
go.temporal.io/server/api/adminservice/v1/request_response.pb.go 5 introduced LOC · 1 range

Open complete file

3586 mi := &file_temporal_server_api_adminservice_v1_request_response_proto_msgTypes[57]
3587 if x != nil {
3588 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) request_response.pb.go
3589 > if ms.LoadMessageInfo() == nil {
3590 > ms.StoreMessageInfo(mi)
3591 > }
3592 > return ms
3593 }
3594 return mi.MessageOf(x)
go.temporal.io/server/api/persistence/v1/executions.pb.go 4 introduced LOC · 1 range

Open complete file

522 }
523
524 > func (x *WorkflowExecutionInfo) GetLastUpdateTime() *timestamppb.Timestamp { executions.pb.go
525 > if x != nil {
526 > return x.LastUpdateTime
527 > }
528 return nil
529 }