Move to PG 12
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> *This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.* <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> ### Overview We are several versions behind on the PostgreSQL versions supported in GitLab. PG 12 has been released. GitLab currently supports 9.6 and 10. We would like to move GitLab to more current versions of PostgreSQL so that we can benefit from improved performance and functionality in PostgreSQL, such as partitioning. * Removing the older versions of PG is a breaking change that needs to be timed with a major GitLab release. * The next major GitLab release is 13.0 scheduled for May 2020. * GitLab releases [one major release per year](https://docs.gitlab.com/ee/policy/maintenance.html) * PostgreSQL has one major release per year ### Long-term goal The long-term goal is for the minimum required version of PostgreSQL to be no more than two versions behind the latest. This means adding and removing one PostgreSQL major version with each major release of GitLab. ### Proposal To fall into a regular pattern of being on the second and third most recent major releases of PostgreSQL, we will need to get caught up by moving a little faster on removals and additions between now and May 2020. The proposed timeline is as follows: * Add support for PG 11 as soon as possible (currently scheduled to start with a research spike in %"12.6". PG 11 support is released as opt in. PG 9.6 and PG 10 are still supported. * Test upgrades to PG 11 and resolve issues * PG 11 becomes the default version in 12.10 (manual upgrade for HA and Geo installs, auto upgrade for all other installs) * PG 11 becomes a minimum requirement in GitLab 13.0 in May 2020 * PG 9 and 10 are both removed in GitLab 13.0. * PG 12 is added in 13.2 as an option for new, single node installs. Support for multi node installs, upgrades, failover, and Geo added in 13.4 and 13.5. * PG 12 becomes the default version for new installs of GitLab in 13.6 and for upgrades in 13.7. * Add PG 13 in GitLab 14.x * Remove PG 11 in GitLab 14.0 At this point we should be able to stay on a cadence of supporting the second and third most recent releases of PG. ### Additional Context **How we got behind** Prior to GitLab 12, GitLab major releases happened as needed, rather than once a year. Typically this meant they happened more than once a year. With that in mind, our previous postgres upgrade plan, was to: * Introduce a new PG version in a minor release as opt-in * Switch the new PG version to opt out in a major release * Remove the old PG version in the NEXT major release This old method, due to how we timed Major releases, meant that we would removing a PG version every OTHER major release. And a need such as what we've encountered with wanting to use PG11 as a minimum, would be sufficient reason for a new major Release of GitLab to get things moving. When we switched to the yearly release, we continued to follow this plan, and as a result have ended up further behind in postgres versions than we intended. ### FAQ * Q: When was PG9.6 and PG10 support introduced? * A: PG 10 was introduced in [11.11](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3308). PG 9.6 was introduced in [8.14](https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1058). * Q: When was PG 11 initially released? * A: [October 2018](https://www.postgresql.org/about/news/1894/) * Q: Will GitLab automatically update Postgres for those who have installed it via Omnibus or Charts? * A: Yes. As we have in the past for PG 9.6 and 10 upgrade, we will make the upgrade opt-in initially, followed by opt-out, then required in 13.0. We will keep this epic up to date on which versions each of these changes will be in. Release post removal notice MR: https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/34740 MR for removal note in docs: https://gitlab.com/gitlab-org/gitlab/merge_requests/19999 ### Process improvements To help improve the process for adding and removing major PostgreSQL versions, please add suggestions to https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/4180 or https://docs.gitlab.com/omnibus/development/managing-postgresql-versions.html
epic