Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenerateReplicationTasks activity of ForceReplicationWorkflow should only log not found errors opposed to returning the error as well #6468

Open
hferentschik opened this issue Aug 30, 2024 · 0 comments · May be fixed by #6469

Comments

@hferentschik
Copy link

Expected Behavior

When generating replication tasks in GenerateReplicationTasks, not found errors from the underlying historyClient.GenerateLastHistoryReplicationTasks should only be logged.

Workflows can for example be archived between being listed and then processed in GenerateReplicationTasks. A not found history should just be logged. Returning the error keep retrying the activity

Actual Behavior

Due to returning the error the activity gets retried and does not make any progress anymore.

	for i := startIndex; i < len(request.Executions); i++ {
		we := request.Executions[i]
		if err := a.generateWorkflowReplicationTask(ctx, rateLimiter, definition.NewWorkflowKey(request.NamespaceID, we.WorkflowId, we.RunId)); err != nil {
			if !isNotFoundServiceError(err) {
				a.logger.Error("force-replication failed to generate replication task", tag.WorkflowNamespaceID(request.NamespaceID), tag.WorkflowID(we.WorkflowId), tag.WorkflowRunID(we.RunId), tag.Error(err))
				return err
			}
		}

		activity.RecordHeartbeat(ctx, i)
	}

Steps to Reproduce the Problem

  1. Execute a ForceReplicationWorkflow run for a given workflow which will archive directly once completed
  2. Complete the workflow in between ListWorkflows and GenerateReplicationTasks

Specifications

  • Version: main
  • Platform:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant