Updating associated pipeline in batches when destroying schedule
requested to merge 328596-backend-query-cancelled-due-to-statement-timeout-when-destroying-a-scheduled-pipeline into master
What does this MR do and why?
Currently, when destroying a pipeline schedule that has many related pipelines > 75k. The destroy request times out since it's one big query.
By pre-emptively unlinking the related pipelines in batches, this should allow the pipeline schedule to be destroy without timing out.
Previous Database Query:
https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/15852/commands/54851
Current Approx. Database Query?:
https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/15855/commands/54854
Screenshots or screen recordings
N/A
How to set up and validate locally
Ensure Pipeline Schedule #destroy still works
- Set up a pipeline schedule
- Trigger it so there's pipelines
- When destroying the pipeline schedule ensure
- Pipelines related to schedule no longer have the schedule id linked
- Pipeline schedule is destroyed
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #328596 (closed)
Edited by Max Fan