patch PostgreSQL to 14.15 and 16.6 to fix a bug with foreign key constraints (and other bugs)
Acceptance criteria
-
Add PostgreSQL to renovate -
Upgrade PostgreSQL to 16.6 and 14.15 (or later) -
Update our documentation to specify 16.5, 15.9, and 14.14 as the minimum versions since these contain this FK fix.
Summary
Ask:
-
Bump PostgreSQL in Omnibus to 16.6 and 14.15 (or later) to get the latest fixes, including one relating to foreign key constraints.
-
Update our documentation to specify 16.5, 15.9, and 14.14 as the minimum versions since these contain this FK fix.
We've run into an issue on PostgreSQL 16.4 where foreign key constraints stop working, and so deletes are not propagated to other tables.
We have one specific table where this has happened on GitLab.com, it is not yet known if other tables are also affected.
Reproduction of the issue has demonstrated that it occurs on 16.4 and not 16.6.
My understanding is that this has happened as part of normal operations in the product - adding and removing partitions either dynamically in Rails or as part of database migrations.
Steps to reproduce
What is the current bug behavior?
The PostgreSQL versions currently shipping with Omnibus are susceptible to this bug.
If it happens to customers, their tables will accumulate records which violate a foreign key constraint (by referring to a record on another table that has been deleted).
This occurs silently; the constraint is "in force" but isn't actually operating because the triggers used by the FK constraint are missing or broken.
If the FK constraint gets recreated or validated for some reason (for example: dump and restore, or a future upgrade migration) this will might result in an inoperable GitLab instance.