Skip to content

batches: Retry batch spec execution

Administrator requested to merge rc/retry-batch-spec-execution into main

Created by: Piszmog

Closes #37006 (closed).

The RetryBatchSpecExecution function today essentially,

  • Checks the batch change to see if it has been applied
  • Retrieves all the associated batch_spec_workspaces
  • Retrieves all the associated batch_spec_workspace_execution_jobs
  • Filters the jobs down to any that are not completed and,
    • job id to delete the associated jobs
    • jobs' associated workspace to delete change specs
    • jobs' associated workspace to retry

As part of the above flow, we reuse queries that are used in other places. This means we are loading in more data than necessary into memory.

I created a new query (ListRetryBatchSpecWorkspaces) to get just the workspaces that we need (with just the columns we care about).

Test plan

Go Unit tests and functional testing

https://user-images.githubusercontent.com/38407415/179546561-5d5b85da-58bd-4286-a933-899fe745daa3.mov

Merge request reports

Loading