Skip to content

Re-remove foreign keys on GitLab.com (LFK)

Kamil Trzciński requested to merge re-remove-foreign-keys-on-gitlab-com into master

What does this MR do and why?

Some migrations were skipped on GitLab.com to avoid blocking deployments.

This tries to use regular deployments to not use change management issues, and mark such migrations as executed if they fail to acquire lock in time.

We assume that if this would be executed today, and late friday or early morning it would finish just fine without having to run change management issues.

Resolves #351363 (closed)

Steps when the deployment fails

In case we encounter deployment failure (due to statement timeout), it's safe to retry the migration. Depending on the traffic, the migration would probably succeed after a few retries.

If the retries don't help then we can safely mark the migration as "done" to unblock the deployment process:

INSERT INTO schema_migrations (version) VALUES ('VERSION_OF_THE_FAILING_MIGRATION');
-- Example: 
-- INSERT INTO schema_migrations (version) VALUES ('20220121214753');

We'll manually remove the foreign keys later.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mayra Cabrera

Merge request reports