Reduce the chances of deadlocks for builds migrations
What does this MR do and why?
When we execute migrations that require locks in CI,
we usually start with ci_builds
first and then
the other tables because ci_builds
is the busiest one.
Creating the artifacts and the updating the job,
locks ci_job_artifacts
and ci_builds
which is
conflicting with the migrations that already have a lock
on ci_builds
, making the migration to fail with deadlock
errors.
Related to gitlab-com/gl-infra/production#8521 (comment 1308619488)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
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.