Draft: Remove code from problematic migration and restore structure.sql
What does this MR do and why?
This MR is part of a larger plan to mitigate a migration which is taking too long and blocking deployments.
This is the plan.
PLEASE REVIEW THIS PLAN (in addition to the source code change included by this MR)
What has already happened:
- We merged !84308 (merged) recently, during 14.10
- We dropped the index on staging
- We began the migration on production
- A production incident has been opened because the migration has been running for over an hour
What we would like to do:
- [For @drew] Create the MR to revert the migration out of the release.
- Done: !84987 (closed)
- [For EOC (@nnelson)] Manually kill the migration on production to end the transaction.
- Create a production change request for this.
- Kill the deployment job.
- Check the status of the
82178
statement:DROP INDEX CONCURRENTLY "ci_job_artifacts_expire_at_unlocked_idx"
- If the process is still running, then forcibly
cancel
it. - If the process is still running, then forcible
terminate
it.
- Find a reviewer+merger (backend maintainer) to merge the new MR from
step 1.
. - Merge the new MR from
step 1.
that removes the actual migration code from #up and #down in the existing, previously merged migration effectively making it a no-op - [For @rpereira2] Validate that the auto-deploy package contains the commit from the revert MR.
- [Anyone] Manually run
migrate:down
onstaging only
, to rebuild the index and bring the staging database back into parity with the production database- Shell into the
console-01-sv-gstg.c.gitlab-staging-1.internal
system. - Invoke:
rake db:migrate:down VERSION=20220404184814
- Shell into the
- Deploy again to staging and production, which will both run an empty migration, successfully, and leave the indexes in place in both environments
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
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.
Edited by drew stachon