ack_manager.go ×7

Frontier kind: Code frontier

unlabeled · c_00fb9b7e661b

5 tests · 4732 LOC · 195 files · introduces 0 tests · 81 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges81 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
754 ranges4732 lines · 195 files · Browse complete extent
All tests (intent)
5 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: 81 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/replication/raw_task_converter.go 59 introduced LOC · 7 ranges

Open complete file

342 logger log.Logger,
343 config *configs.Config,
344 > ) (*replicationspb.ReplicationTask, error) { raw_task_converter.go
345 > currentVersionHistory, currentEvents, newEvents, currentBaseWorkflowInfo, err := getVersionHistoryAndEventsWithNewRun(
346 > ctx,
347 > shardContext,
348 > shardID,
349 > definition.NewWorkflowKey(taskInfo.NamespaceID, taskInfo.WorkflowID, taskInfo.RunID),
350 > taskInfo.Version,
351 > taskInfo.FirstEventID,
352 > taskInfo.NextEventID,
353 > taskInfo.NewRunID,
354 > workflowCache,
355 > eventBlobCache,
356 > executionManager,
357 > logger,
358 > )
359 > if err != nil {
360 return nil, err
361 }
442 executionManager persistence.ExecutionManager,
443 logger log.Logger,
444 > ) ([]*historyspb.VersionHistoryItem, []*commonpb.DataBlob, *workflowspb.BaseExecutionInfo, error) { raw_task_converter.go
445 > if eventBlobCache != nil {
446 if xdcCacheValue, ok := eventBlobCache.Get(persistence.NewXDCCacheKey(
447 workflowKey,
452 }
453 }
454 > versionHistory, branchToken, baseWorkflowInfo, err := getBranchToken( raw_task_converter.go
455 > ctx,
456 > shardContext,
457 > workflowKey,
458 > workflowCache,
459 > firstEventID,
460 > eventVersion,
461 > )
462 > if err != nil {
463 return nil, nil, nil, err
464 }
486 executionManager persistence.ExecutionManager,
487 logger log.Logger,
488 > ) ([]*historyspb.VersionHistoryItem, []*commonpb.DataBlob, *commonpb.DataBlob, *workflowspb.BaseExecutionInfo, error) { raw_task_converter.go
489 > versionHistory, eventBatches, baseWorkflowInfo, err := getVersionHistoryAndEvents(
490 > ctx,
491 > shardContext,
492 > shardID,
493 > definition.NewWorkflowKey(workflowKey.NamespaceID, workflowKey.WorkflowID, workflowKey.RunID),
494 > eventVersion,
495 > firstEventID,
496 > nextEventID,
497 > workflowCache,
498 > eventBlobCache,
499 > executionManager,
500 > logger,
501 > )
502 > if err != nil {
503 return nil, nil, nil, nil, err
504 }
544 eventID int64,
545 eventVersion int64,
546 > ) (_ []*historyspb.VersionHistoryItem, _ []byte, _ *workflowspb.BaseExecutionInfo, retError error) { raw_task_converter.go
547 > // CHASM runs don't have events so should never reach here.
548 > // We can continue to use GetOrCreateWorkflowExecution.
549 > wfContext, release, err := workflowCache.GetOrCreateWorkflowExecution(
550 > ctx,
551 > shardContext,
552 > namespace.ID(workflowKey.NamespaceID),
553 > &commonpb.WorkflowExecution{
554 > WorkflowId: workflowKey.WorkflowID,
555 > RunId: workflowKey.RunID,
556 > },
557 > locks.PriorityLow,
558 > )
559 > if err != nil {
560 return nil, nil, nil, err
561 }
562 > defer func() { release(retError) }() raw_task_converter.go
563
564 > ms, err := wfContext.LoadMutableState(ctx, shardContext) raw_task_converter.go
565 > switch err.(type) {
566 case nil:
567 return persistence.GetXDCCacheValue(ms.GetExecutionInfo(), eventID, eventVersion)
go.temporal.io/server/service/history/replication/ack_manager.go 22 introduced LOC · 7 ranges

Open complete file

301 // iter.HasNext() should be the last check to avoid extra page read in case if replicationTasks is already full.
302 for len(replicationTasks) < p.pageSize() && skippedTaskCount <= p.maxSkipTaskCount() && iter.HasNext() {
303 > task, err := iter.Next() ack_manager.go
304 > if err != nil {
305 return p.swallowPartialResultsError(replicationTasks, lastTaskID, err)
306 }
311 // If error has occurred though, lastTaskID shouldn't be updated, and next time task needs to be read again.
312
313 > ns, err := p.namespaceRegistry.GetNamespaceByID(namespace.ID(task.GetNamespaceID())) ack_manager.go
314 > if err != nil {
315 if _, isNotFound := err.(*serviceerror.NamespaceNotFound); !isNotFound {
316 return p.swallowPartialResultsError(replicationTasks, lastTaskID, err)
322 }
323 // If namespace doesn't exist on polling cluster, there is no reason to send the task.
324 > if !ns.IsOnCluster(pollingCluster) { ack_manager.go
325 lastTaskID = task.GetTaskID()
326 skippedTaskCount++
328 }
329
330 > replicationTask, err := p.ConvertTask(ctx, task) ack_manager.go
331 > if err != nil {
332 return p.swallowPartialResultsError(replicationTasks, lastTaskID, err)
333 > } else if replicationTask == nil { ack_manager.go
334 lastTaskID = task.GetTaskID()
335 skippedTaskCount++
409 ctx context.Context,
410 task tasks.Task,
411 > ) (*replicationspb.ReplicationTask, error) { ack_manager.go
412 > switch task := task.(type) {
413 case *tasks.SyncActivityTask:
414 return convertActivityStateReplicationTask(
425 p.workflowCache,
426 )
427 > case *tasks.HistoryReplicationTask: ack_manager.go
428 > return convertHistoryReplicationTask(
429 > ctx,
430 > p.shardContext,
431 > task,
432 > p.shardContext.GetShardID(),
433 > p.workflowCache,
434 > p.eventBlobCache,
435 > p.executionMgr,
436 > p.logger,
437 > p.config,
438 > )
439 case *tasks.SyncHSMTask:
440 return convertSyncHSMReplicationTask(