Skip to content

Revert "Merge branch '382567-partition-package-metadata' into 'master'"

Nao Hashizume requested to merge revert-c49d1d8b into master

What does this MR do and why?

This reverts !104155 (merged) which caused broken FOSS master: gitlab-org/quality/engineering-productivity/master-broken-incidents#553 (closed).

Quoting investigation note from #387761 (comment 1234982277):

Looks like the error is coming from: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/db/structure.sql#L36270-36271:

ALTER TABLE pm_package_versions
    ADD CONSTRAINT fkey_fb6234c446 FOREIGN KEY (pm_package_id, purl_type) REFERENCES pm_packages(id, purl_type) ON DELETE CASCADE;

I think the root cause here is that PG11 does not support foreign keys referencing partitioned tables (however, foreign key references from partitioned tables are supported).

This chapter about table partitioning in PG11 docs describes this limitation:

5.10.2.3. Limitations

While primary keys are supported on partitioned tables, foreign keys referencing partitioned tables are not supported. (Foreign key references from a partitioned table to some other table are supported.)

Closes #387761 (closed)

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 Nao Hashizume

Merge request reports