Re-do swapping columns for ci_pipelines
What does this MR do and why?
There was an incident (at here) that failed the migration to swap columns ci_pipelines.auto_canceled_by_id
and ci_pipelines.auto_canceled_by_id_convert_to_bigint
. The cause is that the wraparound prevention autovacuum was running on ci_pipelines
and prevented other process from acquiring the ACCESS EXCLUSIVE
lock on table ci_pipelines
. Therefore, the migration failed to obtain the required locks on ci_pipelines
and blocked the other post deployment migrations.
This is to re-introduce the migration to swap bigint conversion columns for ci_pipelines
.
- auto_canceled_by_id
- auto_canceled_by_id_convert_to_bigint
The difference of this migration is that it checks whether there is any autovacuum running on the table ci_pipelines
so that it won't fail if the autovacuum prevents the locks from being acquired and therefore block the other migrations.
See:
- https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#swap-the-columns-release-n--1
- !134038 (comment 1609353784)
- Backfill is done at !126645 (merged) and !129201 (merged)
- Index is created at !129201 (merged) and !131108 (merged)
- Foreign key is created at !132609 (merged) and !133162 (merged)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
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.
Related to #422810 (closed)