Skip to content

Commit f756104

Browse files
authored
Merge pull request #222127 from AwdotiaRomanowna/20221221-read-replica-metrics
master to primary
2 parents bc2c3c8 + 74bc972 commit f756104

9 files changed

+53
-73
lines changed

articles/postgresql/flexible-server/concepts-logical.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Logical replication and logical decoding have several similarities. They both:
2929

3030

3131
The two technologies have their differences:
32+
3233
Logical replication:
3334
* Allows you to specify a table or set of tables to be replicated.
3435

@@ -65,7 +66,7 @@ Here's some sample code you can use to try out logical replication.
6566

6667
1. Connect to the publisher database. Create a table and add some data.
6768
```SQL
68-
CREATE TABLE basic(id SERIAL, name varchar(40));
69+
CREATE TABLE basic(id SERIAL, name TEXT);
6970
INSERT INTO basic(name) VALUES ('apple');
7071
INSERT INTO basic(name) VALUES ('banana');
7172
```
@@ -149,7 +150,7 @@ Here is an example of configuring pglogical at the provider database server and
149150
SELECT subscription_name, status FROM pglogical.show_subscription_status();
150151
```
151152

152-
>[!NOTE]
153+
>[!CAUTION]
153154
> Pglogical does not currently support an automatic DDL replication. The initial schema can be copied manually using pg_dump --schema-only. DDL statements can be executed on the provider and subscriber at the same time by using the pglogical.replicate_ddl_command function. Please be aware of other limitations of the extension listed [here](https://github.com/2ndQuadrant/pglogical#limitations-and-restrictions).
154155
155156

articles/postgresql/flexible-server/concepts-read-replicas.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,20 @@ psql -h myreplica.postgres.database.azure.com -U myadmin postgres
7474

7575
At the prompt, enter the password for the user account.
7676

77-
[//]: # (## Monitor replication)
77+
## Monitor replication
7878

79-
[//]: # ()
80-
[//]: # (Azure Database for PostgreSQL provides two metrics for monitoring replication. The two metrics are **Max Lag Across Replicas** and **Replica Lag**. To learn how to view these metrics, see the **Monitor a replica** section of the [read replica how-to article](how-to-read-replicas-portal.md).)
81-
82-
[//]: # ()
83-
[//]: # (The **Max Lag Across Replicas** metric shows the lag in bytes between the primary and the most-lagging replica. This metric is applicable and available on the primary server only, and will be available only if at least one of the read replica is connected to the primary and the primary is in streaming replication mode. The lag information does not show details when the replica is in the process of catching up with the primary using the archived logs of the primary in a file-shipping replication mode.)
84-
85-
[//]: # ()
86-
[//]: # (The **Replica Lag** metric shows the time since the last replayed transaction. If there are no transactions occurring on your primary server, the metric reflects this time lag. This metric is applicable and available for replica servers only. Replica Lag is calculated from the `pg_stat_wal_receiver` view:)
87-
88-
[//]: # ()
89-
[//]: # (```SQL)
90-
91-
[//]: # (SELECT EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp());)
79+
Azure Database for PostgreSQL - Flexible Server provides [two metrics](concepts-monitoring.md#replication) for monitoring replication. The two metrics are **Max Physical Replication Lag** and **Read Replica Lag**. To learn how to view these metrics, see the **Monitor a replica** section of the [read replica how-to article](how-to-read-replicas-portal.md#monitor-a-replica).
9280

93-
[//]: # (```)
81+
The **Max Physical Replication Lag** metric shows the lag in bytes between the primary and the most-lagging replica. This metric is applicable and available on the primary server only, and will be available only if at least one of the read replicas is connected to the primary. The lag information is present also when the replica is in the process of catching up with the primary, during replica creation, or when replication becomes inactive. The lag information will not be available in case replication switches from using streaming replication to the archive recovery mode using archived files from primary.
9482

95-
[//]: # ()
96-
[//]: # (Set an alert to inform you when the replica lag reaches a value that isn’t acceptable for your workload.)
83+
The **Read Replica Lag** metric shows the time since the last replayed transaction. For instance if there are no transactions occurring on your primary server, and the last transaction was replayed 5 seconds ago, then the Read Replica Lag will show 5 second delay. This metric is applicable and available on replicas only.
9784

98-
[//]: # ()
99-
[//]: # (For additional insight, query the primary server directly to get the replication lag in bytes on all replicas.)
85+
Set an alert to inform you when the replica lag reaches a value that isn’t acceptable for your workload.
10086

101-
[//]: # ()
102-
[//]: # (> [!NOTE])
87+
For additional insight, query the primary server directly to get the replication lag on all replicas.
10388

104-
[//]: # (> If a primary server or read replica restarts, the time it takes to restart and catch up is reflected in the Replica Lag metric.)
89+
> [!NOTE]
90+
> If a primary server or read replica restarts, the time it takes to restart and catch up is reflected in the Replica Lag metric.
10591
10692
## Promote replicas
10793

articles/postgresql/flexible-server/how-to-bulk-load-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ To create an unlogged table or change an existing table to an unlogged table, us
9090
9191
Before you begin an initial data load on the flexible server, we recommend that you:
9292
93-
- Disable high availability on the server. You can enable it after the initial load is completed on master/primary.
93+
- Disable high availability on the server. You can enable it after the initial load is completed on the primary.
9494
- Create read replicas after the initial data load is completed.
9595
- Make logging minimal or disable it altogether during initial data loads (for example: disable pgaudit, pg_stat_statements, query store).
9696

articles/postgresql/flexible-server/how-to-read-replicas-portal.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to manage read replicas Azure Database for PostgreSQL - F
44
ms.service: postgresql
55
ms.subservice: flexible-server
66
ms.topic: how-to
7-
ms.author: srranga
8-
author: sr-msft
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
99
ms.date: 10/14/2022
1010
---
1111

@@ -117,46 +117,39 @@ You can also delete the read replica from the **Replication** window by followin
117117

118118
:::image type="content" source="./media/how-to-read-replicas-portal/delete-confirm.png" alt-text="Confirm to delete te replica":::
119119

120-
[//]: # (## Monitor a replica)
120+
## Monitor a replica
121121

122-
[//]: # ()
123-
[//]: # (Two metrics are available to monitor read replicas.)
122+
Two metrics are available to monitor read replicas.
124123

125-
[//]: # ()
126-
[//]: # (### Max Lag Across Replicas metric)
124+
### Max Physical Replication Lag
125+
> Available only on the primary.
127126
128-
[//]: # ()
129-
[//]: # (The **Max Lag Across Replicas** metric shows the lag in bytes between the primary server and the most-lagging replica.)
127+
The **Max Physical Replication Lag** metric shows the lag in bytes between the primary server and the most-lagging replica.
130128

131-
[//]: # ()
132-
[//]: # (1. In the Azure portal, select the primary Azure Database for PostgreSQL server.)
129+
1. In the Azure portal, select the primary server.
133130

134-
[//]: # ()
135-
[//]: # (2. Select **Metrics**. In the **Metrics** window, select **Max Lag Across Replicas**.)
131+
2. Select **Metrics**. In the **Metrics** window, select **Max Physical Replication Lag**.
136132

137-
[//]: # ()
138-
[//]: # ( :::image type="content" source="./media/how-to-read-replicas-portal/select-max-lag.png" alt-text="Monitor the max lag across replicas":::)
133+
:::image type="content" source="./media/how-to-read-replicas-portal/metrics_max_physical_replication_lag.png" alt-text="Screenshot of the Metrics blade showing Max Physical Replication Lag metric.":::
134+
135+
:::image-end:::
139136

140-
[//]: # ()
141-
[//]: # (3. For your **Aggregation**, select **Max**.)
137+
3. For your **Aggregation**, select **Max**.
142138

143-
[//]: # ()
144-
[//]: # (### Replica Lag metric)
139+
### Read Replica Lag metric
140+
> Available only on replicas.
145141
146-
[//]: # ()
147-
[//]: # (The **Replica Lag** metric shows the time since the last replayed transaction on a replica. If there are no transactions occurring on your master, the metric reflects this time lag.)
142+
The **Read Replica Lag** metric shows the time since the last replayed transaction on a replica. If there are no transactions occurring on your primary, the metric reflects this time lag.
148143

149-
[//]: # ()
150-
[//]: # (1. In the Azure portal, select the Azure Database for PostgreSQL read replica.)
144+
1. In the Azure portal, select read replica.
151145

152-
[//]: # ()
153-
[//]: # (2. Select **Metrics**. In the **Metrics** window, select **Replica Lag**.)
146+
2. Select **Metrics**. In the **Metrics** window, select **Read Replica Lag**.
154147

155-
[//]: # ()
156-
[//]: # ( :::image type="content" source="./media/how-to-read-replicas-portal/select-replica-lag.png" alt-text="Monitor the replica lag":::)
148+
:::image type="content" source="./media/how-to-read-replicas-portal/metrics_read_replica_lag.png" alt-text=" screenshot of the Metrics blade showing Read Replica Lag metric.":::
149+
150+
:::image-end:::
157151

158-
[//]: # ()
159-
[//]: # (3. For your **Aggregation**, select **Max**.)
152+
3. For your **Aggregation**, select **Max**.
160153

161154
## Next steps
162155

121 KB
Loading
120 KB
Loading

articles/postgresql/single-server/how-to-read-replicas-cli.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to manage read replicas in Azure Database for PostgreSQL
44
ms.service: postgresql
55
ms.subservice: single-server
66
ms.topic: how-to
7-
ms.author: srranga
8-
author: sr-msft
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
99
ms.date: 06/24/2022
1010
ms.custom: devx-track-azurecli
1111
---
@@ -62,13 +62,13 @@ You can create and manage read replicas using the Azure CLI.
6262

6363
The [az postgres server replica create](/cli/azure/postgres/server/replica#az-postgres-server-replica-create) command requires the following parameters:
6464

65-
| Setting | Example value | Description |
66-
| --- | --- | --- |
67-
| resource-group | myresourcegroup | The resource group where the replica server will be created. |
68-
| name | mydemoserver-replica | The name of the new replica server that is created. |
69-
| source-server | mydemoserver | The name or resource ID of the existing primary server to replicate from. Use the resource ID if you want the replica and master's resource groups to be different. |
65+
| Setting | Example value | Description |
66+
| --- | --- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
67+
| resource-group | myresourcegroup | The resource group where the replica server will be created. |
68+
| name | mydemoserver-replica | The name of the new replica server that is created. |
69+
| source-server | mydemoserver | The name or resource ID of the existing primary server to replicate from. Use the resource ID if you want the replica and primary's resource groups to be different. |
7070

71-
In the CLI example below, the replica is created in the same region as the master.
71+
In the CLI example below, the replica is created in the same region as the primary.
7272

7373
```azurecli-interactive
7474
az postgres server replica create --name mydemoserver-replica --source-server mydemoserver --resource-group myresourcegroup
@@ -88,7 +88,7 @@ If you haven't set the `azure.replication_support` parameter to **REPLICA** on a
8888
> [!IMPORTANT]
8989
> Review the [considerations section of the Read Replica overview](concepts-read-replicas.md#considerations).
9090
>
91-
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the master.
91+
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the primary.
9292
9393
### List replicas
9494

@@ -173,10 +173,10 @@ PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
173173
174174
If you haven't set the `azure.replication_support` parameter to **REPLICA** on a General Purpose or Memory Optimized primary server and restarted the server, you receive an error. Complete those two steps before you create a replica.
175175

176-
A replica is created by using the same compute and storage settings as the master. After a replica is created, several settings can be changed independently from the primary server: compute generation, vCores, storage, and back-up retention period. The pricing tier can also be changed independently, except to or from the Basic tier.
176+
A replica is created by using the same compute and storage settings as the primary. After a replica is created, several settings can be changed independently from the primary server: compute generation, vCores, storage, and back-up retention period. The pricing tier can also be changed independently, except to or from the Basic tier.
177177

178178
> [!IMPORTANT]
179-
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the master.
179+
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the primary.
180180
181181
### List replicas
182182

articles/postgresql/single-server/how-to-read-replicas-portal.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to manage read replicas Azure Database for PostgreSQL - S
44
ms.service: postgresql
55
ms.subservice: single-server
66
ms.topic: how-to
7-
ms.author: srranga
8-
author: sr-msft
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
99
ms.date: 06/24/2022
1010
---
1111

@@ -34,7 +34,7 @@ To configure the right level of logging, use the Azure replication support param
3434
3535
## Prepare the primary server
3636

37-
1. In the Azure portal, select an existing Azure Database for PostgreSQL server to use as a master.
37+
1. In the Azure portal, select an existing Azure Database for PostgreSQL server to use as a primary.
3838

3939
2. From the server's menu, select **Replication**. If Azure replication support is set to at least **Replica**, you can create read replicas.
4040

@@ -84,7 +84,7 @@ After the read replica is created, it can be viewed from the **Replication** win
8484
> [!IMPORTANT]
8585
> Review the [considerations section of the Read Replica overview](concepts-read-replicas.md#considerations).
8686
>
87-
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the master.
87+
> Before a primary server setting is updated to a new value, update the replica setting to an equal or greater value. This action helps the replica keep up with any changes made to the primary.
8888
8989
## Stop replication
9090

@@ -174,7 +174,7 @@ The **Max Lag Across Replicas** metric shows the lag in bytes between the primar
174174

175175
### Replica Lag metric
176176

177-
The **Replica Lag** metric shows the time since the last replayed transaction on a replica. If there are no transactions occurring on your master, the metric reflects this time lag.
177+
The **Replica Lag** metric shows the time since the last replayed transaction on a replica. If there are no transactions occurring on your primary, the metric reflects this time lag.
178178

179179
1. In the Azure portal, select the Azure Database for PostgreSQL read replica.
180180

articles/postgresql/single-server/how-to-read-replicas-powershell.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Learn how to set up and manage read replicas in Azure Database for
44
ms.service: postgresql
55
ms.subservice: single-server
66
ms.topic: how-to
7-
ms.author: srranga
8-
author: sr-msft
7+
ms.author: alkuchar
8+
author: AwdotiaRomanowna
99
ms.date: 06/24/2022
1010
ms.custom: devx-track-azurepowershell
1111
---
@@ -78,7 +78,7 @@ By default, read replicas are created with the same server configuration as the
7878

7979
> [!NOTE]
8080
> It is recommended that the replica server's configuration should be kept at equal or greater
81-
> values than the primary to ensure the replica is able to keep up with the master.
81+
> values than the primary to ensure the replica is able to keep up with the primary.
8282
8383
### List replicas for a primary server
8484

0 commit comments

Comments
 (0)