scavenger.go ×7

Frontier kind: Code frontier

unlabeled · c_48e6d228b654

4 tests · 2388 LOC · 97 files · introduces 0 tests · 33 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges33 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
436 ranges2388 lines · 97 files · Browse complete extent
All tests (intent)
4 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: 33 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/scanner/history/scavenger.go 33 introduced LOC · 7 ranges

Open complete file

160 }
161
162 > select { scavenger.go
163 > case reqCh <- *task:
164 // noop
165
189 }
190
191 > s.heartbeat(ctx) scavenger.go
192 > s.handleErr(s.handleTask(ctx, task))
193 }
194 }
227 return nil
228 }
229 > shardID := common.WorkflowIDToHistoryShard(namespaceID, workflowID, s.numShards) scavenger.go
230 >
231 > branchToken, err := s.serializer.HistoryBranchToBlob(branch.BranchInfo)
232 > if err != nil {
233 s.logger.Error("unable to serialize the history branch token", tag.DetailInfo(branch.Info), tag.Error(err))
234 metrics.HistoryScavengerErrorCount.With(s.metricsHandler).Record(1)
240 }
241
242 > return &taskDetail{ scavenger.go
243 > shardID: shardID,
244 > namespaceID: namespaceID,
245 > workflowID: workflowID,
246 > runID: runID,
247 > branchToken: branchToken.Data,
248 > }
249 }
250
252 ctx context.Context,
253 task taskDetail,
254 > ) error { scavenger.go
255 > // this checks if the mutableState still exists
256 > // if not then the history branch is garbage, we need to delete the history branch
257 > ms, err := s.client.DescribeMutableState(ctx, &historyservice.DescribeMutableStateRequest{
258 > NamespaceId: task.namespaceID,
259 > Execution: &commonpb.WorkflowExecution{
260 > WorkflowId: task.workflowID,
261 > RunId: task.runID,
262 > },
263 > ArchetypeId: chasm.WorkflowArchetypeID,
264 > })
265 > switch err.(type) {
266 case nil:
267 if s.enableRetentionVerification() {
291 func (s *Scavenger) handleErr(
292 err error,
293 > ) { scavenger.go
294 > s.Lock()
295 > defer s.Unlock()
296 > if err != nil {
297 metrics.HistoryScavengerErrorCount.With(s.metricsHandler).Record(1)
298 s.hbd.ErrorCount++
300 }
301
302 > metrics.HistoryScavengerSuccessCount.With(s.metricsHandler).Record(1) scavenger.go
303 > s.hbd.SuccessCount++
304 }
305