Fix registry migration is incompatible with pre CloudSQL
The migration 20250421061041_create_trigger_for_media_type_id_convert_to_bigint is incompatible with CloudSQL as discussed in https://gitlab.slack.com/archives/CRD4A8HG8/p1748966364673449 .
Summary:
It appears that the Gitlab.com pre environment uses cloudsql which has some DDL incompatability when compared to other types of postgres servers. In this case the 20250421061041_create_trigger_for_media_type_id_convert_to_bigint migration passed on gstg but broke in pre:
failed to run database migrations: applying migration 20250421061041_create_trigger_for_media_type_id_convert_to_bigint: ERROR: "manifests" is a partitioned table (SQLSTATE 42809) handling 20250421061041_create_trigger_for_media_type_id_convert_to_bigint
Update: the problem was we are running an unsupported version of postgres database in pre. see details: #1606 (comment 2544213350)
We will need to take corrective actions to ensure the registry is not broken for self-managed/gitlab.com environments and does not blocks new registry versions from going out.
Immediate corrective actions:
-
Revert registry deployment of v4.23.0 on gstg and pre -
Revert all self managed releases with the problematic registry version -
Remove the migrations from 20250421061041_create_trigger_for_media_type_id_convert_to_bigintupwwards from the registry master branch. -
Take corrective action to fix gstg migration. (if needed)
Continuing corrective action:
-
Identify the problem with: 20250421061041_create_trigger_for_media_type_id_convert_to_bigintmigration -
release a new version of the registry with the fix (if any) going from pre(if cloudsql is upgraded)-> gstsg -> gprd(cny)-> gprd(main)
Follow up discussion
- Version-mismatch/difference between cloudsql & postgres environments and how to support this