batches: Retry batch spec execution
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
- job
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