Skip to content

Convert `project_authorizations.user_id` to LFK

What does this MR do and why?

project_authorizations is a main_cell table now, and users is a main_clusterwide table.

Since these tables belong to 2 different databases now, any foreign keys that exists between these 2 tables should be converted to Loose foreign keys, which is what this MR does.

This MR converts:

  • project_authorizations.user_id

to loose foreign key.

This migration has been generated with the scripts/decomposition/generate-loose-foreign-key project_authorizations script.

There is a risk after this change: A LFK can take upto 2 minutes to clean up associated records on gitlab.com. So, for these 2 minutes a deleted user's record can remain on the project_authorizations table.

However, a user being deleted is not a common action on gitlab.com, and we have also moved many other such columns related to users to LFK, like !134246 (merged), so this is acceptable.

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.

Related to #422044 (closed)

Edited by Manoj M J

Merge request reports

Loading