Swap foreign key `project_pages_metadata.artifacts_archive_id` for loose foreign key
We used this column temporarily when we were migrating pages to new architecture. Now we don't need it anymore, so we need to remove it, and everything which takes it into account.
It's quicker to just remove the foreign key as there is already a loose foreign key in place so we'll save removing the column altogether as follow-up in #348929 (closed)
ci_job_artifacts is referenced as a foreign key from other 1 other tables in a different database
The intention of this issue is to determine any risks when changing all of the below foreign keys referencing ci_job_artifacts to become Loose foreign keys. Loose foreign keys are cleaned up asynchronously which means when we perform a DELETE FROM ci_job_artifacts
we will queue a cleanup task that will be executed in ~5 mins to cleanup all of the rows that reference this record. This can mean there are sometimes strange UX bugs where they may see a link to something that no longer exists and clicking it may give an error or it may mean there is a background job that runs and errors due to an invalid foreign key or it may mean a 500 when rendering a certain page containing any of the below tables. Some more details about risks and mitigations are being documented in !76626 (merged) .
The groupsharding will be responsible for actually doing the work to convert the foreign keys to loose foreign keys but will likely need help from impacted teams to asses the risk and potentially determine or implement appropriate mitigation for any risks. Sometimes mitigation may mean refactoring code slightly to avoid errors or explicitly handling certain riskier cases by checking if there is a pending deletion for a record. It is also possible that we can optimize the 5 minute latency for cleanup in certain cases determined to be urgent.
-
project_pages_metadata.artifacts_archive_id
->ci_job_artifacts.id
-ON DELETE SET NULL
-
Best team to review (check off when reviewed): ~"group::release" ~"devops::release" -
MR: !76996 (merged) -
No way for user to access once parent is deleted. Please explain: <DETAIL>
-
Possible to access once parent deleted but low user impact. Please explain: <DETAIL>
-
Possible Sidekiq workers that may load directly and possibly lead to exceptions. Please explain: <DETAIL>
-
Possible user impact to be evaluated or mitigated. Please explain: <DETAIL>
-