Skip to content

Updating associated pipeline in batches when destroying schedule

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

  1. Set up a pipeline schedule
  2. Trigger it so there's pipelines
  3. 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.

Related to #328596 (closed)

Edited by Max Fan

Merge request reports