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