Skip to content

Commit a340a0c

Browse files
Clemens Beckbalasankarc
authored andcommitted
Auto upgrade single node installs to PostgreSQL 14
Postgres 14 is going to become our minimum supported version in GitLab 17. GitLab 16.11 turns on auto-upgrade for single node installs. Documentation change: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147402 Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8340 Changelog: changed
1 parent 3336c6d commit a340a0c

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

doc/settings/database.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -800,16 +800,16 @@ Before proceeding with the upgrade, note the following:
800800
[default version in the compatibility table](https://docs.gitlab.com/ee/administration/package_information/postgresql_versions.html)
801801
determines which client binaries (such as the PostgreSQL backup/restore binaries) are active.
802802

803-
The following example demonstrates upgrading from a database host running PostgreSQL 12 to another database host running PostgreSQL 13 and incurs downtime:
803+
The following example demonstrates upgrading from a database host running PostgreSQL 13 to another database host running PostgreSQL 14 and incurs downtime:
804804

805-
1. Spin up a new PostgreSQL 13 database server that's set up according to the [database requirements](https://docs.gitlab.com/ee/install/requirements.html#database).
805+
1. Spin up a new PostgreSQL 14 database server that's set up according to the [database requirements](https://docs.gitlab.com/ee/install/requirements.html#database).
806806
807807
1. Ensure that the compatible versions of `pg_dump` and `pg_restore` are being
808808
used on the GitLab Rails instance. To amend GitLab configuration, edit
809809
`/etc/gitlab/gitlab.rb` and specify the value of `postgresql['version']`:
810810
811811
```ruby
812-
postgresql['version'] = 13
812+
postgresql['version'] = 14
813813
```
814814
815815
1. Reconfigure GitLab:
@@ -835,10 +835,10 @@ when your installation is using PgBouncer.
835835
sudo gitlab-backup create SKIP=repositories,uploads,builds,artifacts,lfs,pages,registry
836836
```
837837

838-
1. Shutdown the PostgreSQL 12 database host.
838+
1. Shutdown the PostgreSQL 13 database host.
839839

840840
1. Edit `/etc/gitlab/gitlab.rb` and update the `gitlab_rails['db_host']` setting
841-
to point to the PostgreSQL database 13 host.
841+
to point to the PostgreSQL database 14 host.
842842

843843
1. Reconfigure GitLab:
844844

@@ -910,12 +910,8 @@ gitlab_rails['initial_shared_runners_registration_token'] = 'token'
910910

911911
### Pin the packaged PostgreSQL version (fresh installs only)
912912

913-
NOTE:
914-
GitLab 14.1 and onward shipped with both Postgres 12 and Postgres 13.
915-
GitLab 14.0 only ships with PostgreSQL 12. GitLab 13.3 and onward shipped both Postgres 11 and Postgres 12.
916-
GitLab 13.0 through 13.2 only shipped with PostgreSQL 11.
917-
918-
The Linux package installation initializes PostgreSQL with the [default version](https://docs.gitlab.com/ee/administration/package_information/postgresql_versions.html).
913+
The Linux package ships with [different PostgreSQL versions](https://docs.gitlab.com/ee/administration/package_information/postgresql_versions.html)
914+
and initializes the default version if not specified otherwise.
919915

920916
To initialize PostgreSQL with a non-default version, you can set `postgresql['version']` to the major version one of
921917
the [packaged PostgreSQL versions](https://docs.gitlab.com/ee/administration/package_information/postgresql_versions.html) prior to the initial reconfigure.

docker/assets/wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ gitlab-ctl reconfigure
152152

153153
# This must be false when the opt-in PostgreSQL version is the default for pg-upgrade,
154154
# otherwise it must be true.
155-
ATTEMPT_AUTO_PG_UPGRADE='false'
155+
ATTEMPT_AUTO_PG_UPGRADE='true'
156156

157157
# Make sure PostgreSQL is at the latest version.
158158
# If it fails, print a message with a workaround and exit

files/gitlab-config-template/gitlab.rb.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ external_url 'GENERATED_EXTERNAL_URL'
15211521

15221522
### Version settings
15231523
# Set this if you have disabled the bundled PostgreSQL but still want to use the backup rake tasks
1524-
# postgresql['version'] = 10
1524+
# postgresql['version'] = 14
15251525

15261526

15271527
##! Automatically restart PostgreSQL service when version changes.

files/gitlab-ctl-commands/upgrade.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def postgresql_upgrade_disabled?
334334
end
335335

336336
def geo_detected?
337-
(GitlabCtl::Util.roles(base_path) & %w[geo-primary geo-secondary]).any? || service_enabled?('geo-postgresql')
337+
(GitlabCtl::Util.roles(base_path) & %w[geo_primary geo_secondary]).any? || service_enabled?('geo-postgresql')
338338
end
339339

340340
def patroni_detected?
@@ -344,7 +344,7 @@ def patroni_detected?
344344
def attempt_auto_pg_upgrade?
345345
# This must return false when the opt-in PostgreSQL version is the default for pg-upgrade,
346346
# otherwise it must be true.
347-
false
347+
true
348348
end
349349

350350
def recommend_pg_upgrade?

0 commit comments

Comments
 (0)