Skip to content

Asynchronously validate FK targeting ci_builds

For partitioning ci_builds we have redefined foreign keys to include the partition_id, but we have not validated all of them because it takes too long to do it with regular migrations. #390651 (closed) adds the infrastructure needed for the validation to happen async, it's not fully completed, but it should be enough to get us started.

Proposal

For the tables listed with FK created but invalid on #382033 (closed) and that have cleanup completed on #387301 (closed) we should write a post deployment migration to enqueue their partitioned foreign key for async validation using the helper introduced in !111314 (merged).

Table name FK to validate Can be validated? MR FK valid
ci_sources_pipelines fk_be5624bf37_p !112508 (merged)
ci_build_report_results fk_rails_16cb1ff064_p !112131 (merged)
ci_build_needs fk_rails_3cf221d4ed_p !112130 (merged)
ci_build_trace_metadata fk_rails_aebc78111f_p !112133 (merged)
ci_job_artifacts fk_rails_c5137cb2c1_p !112132 (merged)
ci_job_variables fk_rails_fbf3b34792_p !112511 (merged)
p_ci_builds_metadata partitions fk_e20479742e_p !112788 (merged)
Edited by Marius Bobin