Remove foreign key constraints to namespace_id & project_id from p_duo_workflow_checkpoints
What does this MR do and why?
Remove foreign key constraints to namespace_id & project_id from p_duo_workflow_checkpoints
- Because dropping the old partitions creates incidents due to projects and namespaces being high traffic tables (see issues)
- Because we're dropping older data, we don't really need the data integrity provided by FK constraints
References
- Related to Dropping partitions on p_duo_workflows_checkpoi... (#572109 - closed)
- Related to Avoid recurring lock contention due to add/drop... (#560503 - closed)
- https://docs.gitlab.com/development/database/foreign_keys/
- https://docs.gitlab.com/development/migration_style_guide/
Database migrations
See gitlabdotcom testing output
How to set up and validate locally
Run the migrations and in psql use \d p_duo_workflow_checkpoints to see FK have been dropped
bin/rails db:migrate:up:main VERSION=20251006061109
bin/rails db:migrate:up:main VERSION=20251006061128
Run the migrations and in psql use \d p_duo_workflow_checkpoints to see FK have been restored
bin/rails db:migrate:down:main VERSION=20251006061128
bin/rails db:migrate:down:main VERSION=20251006061109
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Alper Akgun