Migration 20210906145021_link_repository_id is timing out due to a large number of project

One of our customers (internal) performed an upgrade to GitLab 14.4.4. However, they encountered the following error during the database migration:

STDOUT: praefect sql-migrate: fail: pq: canceling statement due to statement timeout handling 20210906145021_link_repository_id

We tried setting the statement timeout to 0 but we hit the internal timeout (3600 seconds) of gitlab-ctl reconfigure.

The customer have ~95,000 projects and they have ~320,000 entries in the storage_repositories table.

This happens when the customer tried to upgrade from GitLab 14.3.4 to GitLab 14.4.4.

Edited by Julian Paul Dasmarinas