Skip to content

Commit d4b678d

Browse files
Merge pull request #226664 from kabharati/pacific020823
Adding a new major version upgrade
2 parents 37ba710 + 7c0bfb8 commit d4b678d

File tree

7 files changed

+149
-0
lines changed

7 files changed

+149
-0
lines changed

articles/postgresql/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@
486486
href: flexible-server/concepts-security.md
487487
- name: Azure AD Authentication
488488
href: flexible-server/concepts-azure-ad-authentication.md
489+
- name: Major Version Upgrade
490+
href: flexible-server/concepts-major-version-upgrade.md
489491
- name: Compliance
490492
href: flexible-server/concepts-compliance.md
491493
- name: Limits
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: Major Version Upgrade - Azure Database for PostgreSQL - Flexible Server Preview
3+
description: Learn about the concepts of in-place major version upgrade with Azure Database for PostgreSQL - Flexible Server
4+
author: kabharati
5+
ms.author: kabharati
6+
ms.reviewer: rajsell
7+
ms.date: 02/08/2023
8+
ms.service: postgresql
9+
ms.subservice: flexible-server
10+
ms.custom: references_regions
11+
ms.topic: conceptual
12+
---
13+
14+
# Major Version Upgrade with PostgreSQL Flexible Server Preview
15+
16+
[!INCLUDE [applies-to-postgresql-Flexible-server](../includes/applies-to-postgresql-Flexible-server.md)]
17+
18+
19+
## Overview
20+
Azure Database for PostgreSQL Flexible server supports PostgreSQL versions 11, 12,13, and 14. Postgres community releases a new major version containing new features about once a year. Additionally, major version receives periodic bug fixes in the form of minor releases. Minor version upgrades include changes that are backward-compatible with existing applications. Azure Database for PostgreSQL Flexible service periodically updates the minor versions during customer’s maintenance window. Major version upgrades are more complicated than minor version upgrades as they can include internal changes and new features that may not be backward-compatible with existing applications.
21+
22+
Azure Database for PostgreSQL Flexible Server Postgres has now introduced in-place major version upgrade feature that performs an in-place upgrade of the server with just a click. In-place major version upgrade simplifies the upgrade process minimizing the disruption to users and applications accessing the server. In-place upgrades are a simpler way to upgrade the major version of the instance, as they retain the server name and other settings of the current server after the upgrade, and don't require data migration or changes to the application connection strings. In-place upgrades are faster and involve shorter downtime than data migration.
23+
24+
25+
## Process
26+
27+
Here are some of the important considerations with in-place major version upgrade.
28+
29+
- During in-place major version upgrade process, Flexible Server runs a pre-check procedure to identify any potential issues that might cause the upgrade to fail. If the pre-check finds any incompatibilities, it creates a log event showing that the upgrade pre-check failed, along with an error message.
30+
31+
- If the pre-check is successful, then Flexible Server stops the service and takes an implicit backup just before starting the upgrade. This backup can be used to restore the database instance to its previous version if there's an upgrade error.
32+
33+
- Flexible Server uses **pg_upgrade** utility to perform in-place major version upgrades and provides the flexibility to skip versions and upgrade directly to higher versions.
34+
35+
- During an in-place major version upgrade of a High Availability (HA) enabled server, the service disables HA, performs the upgrade on the primary server, and then re-enables HA after the upgrade is complete.
36+
37+
- Most extensions are automatically upgraded to higher versions during an in-place major version upgrade, with some exceptions. Refer **limitations** section for more details.
38+
39+
- In-place major version upgrade process for Flexible server automatically deploys the latest supported minor version.
40+
41+
- In-place major version upgrade process is an offline operation and it involves a short downtime.
42+
43+
- Long-running transactions or high workload before the upgrade might increase the time taken to shut down the database and increase upgrade time.
44+
45+
- If an in-place major version upgrade fails, the service restores the server to its previous state using a backup taken as part of step 2.
46+
47+
- Once the in-place major version upgrade is successful, there are no automated ways to revert to the earlier version. However, you can perform a Point-In-Time Recovery (PITR) to a time prior to the upgrade to restore the previous version of the database instance.
48+
49+
## Limitations:
50+
51+
During preview, if in-place major version upgrade pre-check operations fail then it aborts with a detailed error message for all the below limitations.
52+
53+
- In-place major version upgrade currently doesn't support read replicas, so if you have a read replica enabled server, you need to delete the replica before performing the upgrade on the primary server. After the upgrade, you can recreate the replica.
54+
55+
- In-place major version upgrade doesn't support certain extensions and there are some limitations to upgrading certain extensions. The extensions **Timescaledb**, **pgaudit**, **dblink**, and **postgres_fdw** are unsupported for all PostgreSQL versions during preview.
56+
57+
- Upgrading the **PostGIS** extension is currently unsupported from PostgreSQL 12, while upgrading the **orafce** extension is unsupported from PostgreSQL 11. All other versions of these extensions are supported for in-place major version upgrade.
58+
59+
- During preview, in-place major version upgrade is currently available in the following regions.
60+
Australia East / Australia Southeast/ Canada East/ China North 3/China East 3/ East Asia / East US / France South / India Central / India South /Japan East /Jio India West /Korea Central / Norway East/ North Europe/South Central US /Sweden Central /Switzerland North /Switzerland West /UAE north /West Central US/ West US / West US3/ Qatar Central
61+
62+
- Servers configured with logical replication slots aren't supported.
63+
64+
- MVU is currently not supported for PgBouncer enabled servers.
65+
66+
67+
## How to Perform in-place major version upgrade:
68+
69+
It's recommended to perform a dry run of the in-place major version upgrade in a non-production environment before upgrading the production server. It allows you to identify any application incompatibilities and validate that the upgrade completes successfully before upgrading the production environment. You can perform a Point-In-Time Recovery (PITR) of your production server and test the upgrade in the non-production environment. Addressing these issues before the production upgrade minimizes downtime and ensures a smooth upgrade process.
70+
71+
**Steps**
72+
73+
1. You can perform in-place major version upgrade using Azure portal or CLI (command-line interface). Click the **Upgrade** button in Overview blade.
74+
75+
76+
77+
78+
:::image type="content" source="media/concepts-major-version-upgrade/upgrade-tab.png" alt-text="Diagram of Upgrade tab to perform in-place major version upgrade.":::
79+
80+
81+
82+
83+
2. You'll see an option to select the major version of your choice, you have an option to skip versions to directly upgrade to higher versions. Choose the version and click **Upgrade**.
84+
85+
86+
87+
88+
:::image type="content" source="media/concepts-major-version-upgrade/set-postgresql-version.png" alt-text="Diagram of PostgreSQL version to Upgrade.":::
89+
90+
91+
92+
93+
3. During upgrade, users have to wait for the process to complete. You can resume accessing the server once the server is back online.
94+
95+
96+
97+
98+
:::image type="content" source="media/concepts-major-version-upgrade/deployment-progress.png" alt-text="Diagram of deployment progress for major version upgrade.":::
99+
100+
101+
102+
103+
104+
105+
4. Once the upgrade is successful,you can expand the **Deployment details** tab and click **Operation details** to see more information about upgrade process like duration, provisioning state etc.
106+
107+
108+
109+
110+
111+
112+
:::image type="content" source="media/concepts-major-version-upgrade/deployment-success.png" alt-text="Diagram of successful deployment of for major version upgrade.":::
113+
114+
115+
116+
117+
118+
5. You can click on the **Go to resource** tab to validate your upgrade. You notice that server name remained unchanged and PostgreSQL version upgraded to desired higher version with the latest minor version.
119+
120+
121+
122+
123+
124+
:::image type="content" source="media/concepts-major-version-upgrade/upgrade-verification.png" alt-text="Diagram of Upgraded version to Flexible server after major version upgrade.":::
125+
126+
127+
## Post Upgrade
128+
129+
Run the **ANALYZE** operation to refresh the pg_statistic table. You should do this for every database on all your Flexible Server. Optimizer statistics aren't transferred during a major version upgrade, so you need to regenerate all statistics to avoid performance issues. Run the command without any parameters to generate statistics for all regular tables in the current database, as follows
130+
131+
132+
```
133+
ANALYZE VERBOSE
134+
```
135+
> [!NOTE]
136+
>
137+
> The VERBOSE flag is optional, but using it shows you the progress.
138+
139+
## Next steps
140+
141+
- To learn how to create and populate Azure AD, see [Configure and sign in with Azure AD for Azure Database for PostgreSQL](how-to-configure-sign-in-azure-ad-authentication.md).
142+
- To learn how to manage Azure AD users for Flexible Server, see [Manage Azure Active Directory users - Azure Database for PostgreSQL - Flexible Server](how-to-manage-azure-ad-users.md).
143+
144+
<!--Image references-->
145+
146+
[1]: ./media/concepts-azure-ad-authentication/authentication-flow.png
147+
[2]: ./media/concepts-azure-ad-authentication/admin-structure.png
46 KB
Loading
31.4 KB
Loading
70.1 KB
Loading
46 KB
Loading
46.3 KB
Loading

0 commit comments

Comments
 (0)