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

Add an archival task executor #3663

Merged
merged 1 commit into from Dec 13, 2022
Merged

Add an archival task executor #3663

merged 1 commit into from Dec 13, 2022

Conversation

MichaelSnowden
Copy link
Contributor

What changed?
Added a processor which executes tasks on the archival queue. A followup PR will actually enable the queue factory.

Why?
I made these changes to enable the archival queue.

How did you test it?
I tested this using unit tests because it's not actually hooked into prod yet.

Potential risks
No--it's not wired into main yet.

Is hotfix candidate?
No.

service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
@yux0
Copy link
Contributor

yux0 commented Nov 29, 2022

The title should be archival task executor?

service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
@MichaelSnowden MichaelSnowden changed the title Add an archival queue processor Add an archival task executor Nov 29, 2022
@MichaelSnowden MichaelSnowden force-pushed the da-q-processors branch 2 times, most recently from 9bc7a96 to 0457a6d Compare December 1, 2022 21:48
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
service/history/archivalQueueTaskExecutor.go Outdated Show resolved Hide resolved
@MichaelSnowden MichaelSnowden force-pushed the da-q-processors branch 6 times, most recently from 124f601 to 9ee1de8 Compare December 9, 2022 00:21
@MichaelSnowden
Copy link
Contributor Author

+1, need to get sa and memo from ES if a flag in mutable state is set.
Done

service/history/archival_queue_task_executor.go Outdated Show resolved Hide resolved
service/history/archival_queue_task_executor.go Outdated Show resolved Hide resolved
service/history/archival_queue_task_executor.go Outdated Show resolved Hide resolved
if err != nil {
return nil, err
}
if mutableState == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this happen if a workflow is deleted before the archival task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to drop the task and log a warning. Also added a test case for this branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return nil error to drop the task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I return a const error here and then I convert it to nil further up the stack. If I return nil here, then execution will continue because this is a helper method.

@MichaelSnowden MichaelSnowden force-pushed the da-q-processors branch 2 times, most recently from 869d8ed to 604cc96 Compare December 12, 2022 19:09
logger := log.With(e.logger, tag.Task(task))
request, err := e.getArchiveTaskRequest(ctx, logger, task)
if err != nil {
if err == ErrMutableStateIsNil || err == ErrWorkflowExecutionIsStillRunning {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: either handle at the top level in Execute(...) or from the return function loadAndVersionCheckMutableState

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants