PostgreSQL 13 message but pg-upgrade doesn't upgrade

Today after the update gitlab-ce_14.1.0-ce.0 update I get the following message:

=== INFO ===
You are currently running PostgreSQL 12.
Note that PostgreSQL 13 will become the minimum required PostgreSQL version in GitLab 14.0 (May 2021).
PostgreSQL 12 will be removed in GitLab 14.0. Please consider upgrading your PostgreSQL version soon.
To upgrade, please see: https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server
=== INFO ===

Running the pg-upgrade command suggested won’t upgrade postgresql.

$ sudo gitlab-ctl pg-upgrade
Checking for an omnibus managed postgresql: OK
Checking if postgresql['version'] is set: OK
Checking if we already upgraded: OK
The latest version 12.6 is already running, nothing to do

Is the message wrong or did I misread the instructions?

Hi,

This is what I see in the docs: PostgreSQL versions shipped with the Linux package | GitLab

GitLab version PostgreSQL versions Default version for fresh installs Default version for > upgrades Notes
14.1 12.6, 13.3 12.6 12.6 PostgreSQL 13 available for fresh installations if not using Geo or High Availability.
14.0 12.6 12.6 12.6 HA installations with repmgr are no longer supported and will be prevented from upgrading to Omnibus GitLab 14.0

so it still looks like 12.6 being the default for new installs as well as upgrades right now. Normally you don’t need to do it manually, if gitlab requires it, it will do the upgrade automatically. The notes mention 13 being available for fresh installs, but don’t mention about it being ready for upgrades yet. You can see on the link, that for example it wasn’t until 13.7 that 12.4 became available for upgrades manually, and automatic in 13.8.

1 Like

I got the same thing on my omnibus upgrade today. gitlab-ee.x86_64 0:14.1.0-ee.0.el7

I ran the

sudo gitlab-ctl pg-upgrade -V 13

as seen for 12 futher down on Database settings | GitLab and it upgraded to 13.3.

3 Likes

@xicubed thanks for that. Just ran that now on my test environment. As it happens, just found it here also:

for 13.7 it was possible using the additional -V parameter, and then in 13.8 providing the pre-requisites were met it automatically upgraded. I’m not using HA, Geo, and haven’t opted out, but these can be reasons for lack of upgrade ability for postgres:

The upgrade is skipped in any of the following cases:

  • You’re running the database in high availability using repmgr or patroni.
  • Your database nodes are part of GitLab Geo configuration.
  • You have specifically opted out.

will see how my test environment goes before I update production, or perhaps I’ll wait until a 14.1.x or 14.2 release does the automatic upgrade to 13.

After the upgrade I had to do gitlab-ctl restart since in the admin panel was still showing 12.6.

Hi,

thanks for flagging. This is a bug in the Omnibus package which should not ask you to upgrade to PostgreSQL just yet. Corrective actions are in a new MR.

Please ignore the INFO message. Whenever PostgreSQL 13 will be recommended to upgrade to, it will be shared in the release post upgrade notes at the bottom.

Cheers,
Michael

3 Likes

I found this link through Copilot on searching upgradation failed on Gitlab 16.X on my test server running 18.04 LTS. Currently I can successfully migrate up to 15.4.6 with PostgreSQL 12. I am not sure why PostgreSQL not automatically upgraded on 14.x migration phase. If I upgrade the OS to 20.04 LTS does it ?

It’s not related to the OS. If you are using the bundled postgres with Gitlab it should upgrade, but I have also seen occasions when it hasn’t. Just upgrade it manually and then continue the upgrade - I did this recently when I was debugging and fixing a problem for someone.

gitlab-ctl pg-upgrade

Thanks iwalker !!. Postgresql upgraded to 13.8 on Gitlab 15.4.6 test server. I will check on my production server.

1 Like