You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/postgresql/high-availability/concepts-high-availability.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,29 +291,32 @@ When using logical replication or logical decoding with High Availability (HA) i
291
291
### PostgreSQL 16 and earlier
292
292
In PostgreSQL 16 and earlier, logical replication slots aren't automatically preserved on the standby server after a failover. To maintain logical replication across failover, you must:
293
293
- Enable the `pg_failover_slots` extension
294
-
- Configure required settings such as `hot_standby_feedback = on`
294
+
- Configure required settings such as:
295
+
-`hot_standby_feedback = on`
295
296
296
297
Without these configurations, logical replication might stop working after a failover because replication slots aren't available on the new primary.
297
298
298
299
### PostgreSQL 17 and later
299
300
Starting with PostgreSQL 17, logical replication slot synchronization is supported natively. When correctly configured, replication slots are automatically synchronized to the standby server.
301
+
300
302
To enable this behavior:
301
303
- Set `sync_replication_slots = on`
302
304
- Set `hot_standby_feedback = on`
303
305
304
-
With these settings, logical replication slots are preserved during failover, and replication can continue without requiring extensions. For setup steps and prerequisites, refer to the [PG_Failover_Slots extension](../extensions/concepts-extensions-versions.md#pg_failover_slots) documentation.
306
+
With these settings, logical replication slots are preserved during failover, and replication can continue without requiring extensions. For details, refer to the [PG_Failover_Slots extension](../extensions/concepts-extensions-versions.md#pg_failover_slots) documentation.
305
307
306
308
### Important considerations
307
-
- Logical replication slots are managed on the primary server, but **must also exist** on the standby to ensure logical works post HA failover.
308
-
- System views (for example, querying `pg_replication_slots`) only show the state on the primary and don't confirm whether slots are synchronized to the standby. A system can appear healthy on the primary but still not be failover-ready.
309
+
- Logical replication slots are managed on the primary server, but **must also exist** on the standby to ensure logical replication continues after HA failover.
310
+
- System views (for example, querying `pg_replication_slots`) only show the state on the primary and don't confirm whether slots are synchronized to the standby. A system can appear healthy on the primary but still not be failover-ready to preserve logical replication slots on the standby.
To help validate failover readiness, you can use the Azure Monitor metric `logical_replication_slot_sync_status` (Preview).
312
-
This metric indicates whether logical replication slots are synchronized across the HA primary and standby:
314
+
315
+
This metric indicates whether logical replication slots are synchronized between the HA primary and standby:
313
316
-`1` indicates that slots are synchronized across primary and standby.
314
317
-`0` indicates that slots aren't synchronized on the standby.
315
318
316
319
If the metric value is 0, logical replication might continue to function on the current primary, but it might not continue after a failover. For more details, refer to the [Logical replication monitoring](../monitor/concepts-monitoring.md#logical-replication).
317
320
318
-
> [!NOTE]
319
-
> This synchronization state reflects the status across HA nodes and can't be verified using system views on the primary server alone. Consider using this metric with alerts to detect when logical replication isn't failover-ready, especially before planned maintenance or failover events.
321
+
> [!NOTE]
322
+
> This synchronization state reflects the status across HA nodes and can't be verified using system views on the primary alone. Consider using this metric with alerts to detect when logical replication isn't failover-ready, especially before planned maintenance or failover events. Consider configuring alerts when this metric remains 0 for a sustained period.
0 commit comments