# sync_replication_slots

> sync_replication_slots enables a physical standby to synchronize logical failover replication slots from the primary server. It is a sighup setting present in PG17–18; the latest recorded boot default is off.
---

> [!NOTE]
> **Fact — official short description:** “Enables a physical standby to synchronize logical failover replication slots from the primary server.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `bool` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Replication / Standby Servers | Upstream classification |
| Latest boot value | `off` | off |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG17 |
| Present in | PG17–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`93db6cbda037`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=93db6cbda037f1be9544932bd9a785dabf3ff712) — Add a new slot sync worker to synchronize logical slots. |
| Commit date | 2024-02-22 |
| Discussion | [thread 1](https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG17–19 Beta 3 | `off` | — | off |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Enables the slotsync worker on a physical standby to copy logical failover-slot state from its primary. A configuration reload applies a new value.

Synchronization requires a physical replication slot between primary and standby (primary_slot_name on the standby), hot_standby_feedback=on, and primary_conninfo containing a valid dbname. The logical source slots must have failover enabled.

Slot state is copied asynchronously. The primary should list the standby’s physical slot in synchronized_standby_slots so subscribers cannot outrun the failover standby, and operators must verify that every required slot is synchronized and ready before promotion.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Enable it only as part of a complete logical-failover design. Automate prerequisite checks and block planned promotion until all required failover slots report synchronized, non-conflicting state. |
| OLAP | Large transactions and delayed standbys can increase synchronization lag. Monitor subscriber confirmed positions, standby replay, physical-slot retention, and catalog horizon together. |
| Small nodes | Do not enable it merely because the switch is available. A small deployment still needs a permanent physical slot, hot_standby_feedback, dbname, retention limits, and a tested failover runbook. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | `true` | different | `on` |
| OLAP | `true` | different | `on` |
| CRIT | `true` | different | `on` |
| TINY | `true` | different | `on` |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG17–19 Beta 3 = True (dcs); OLAP: PG17–19 Beta 3 = True (dcs); CRIT: PG17–19 Beta 3 = True (dcs); TINY: PG17–19 Beta 3 = True (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to prepare logical failover slots on physical standbys for controlled failover; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.

## Common pitfalls {#common-pitfalls}

- Enabling it without primary_slot_name and therefore without the mandatory physical slot.
- Leaving hot_standby_feedback off, which prevents safe catalog-row retention for synchronized logical slots.
- Omitting dbname from primary_conninfo.
- Synchronizing ordinary logical slots that were not created with failover enabled and expecting them to appear.
- Promoting before checking that every required slot is synchronized and not behind its subscriber.

## Related parameters {#related-parameters}

[`primary_slot_name`](/parameters/primary-slot-name/) · [`hot_standby_feedback`](/parameters/hot-standby-feedback/) · [`primary_conninfo`](/parameters/primary-conninfo/) · [`synchronized_standby_slots`](/parameters/synchronized-standby-slots/) · [`max_replication_slots`](/parameters/max-replication-slots/) · [`max_slot_wal_keep_size`](/parameters/max-slot-wal-keep-size/)

## References {#references}

- [PostgreSQL 19 Beta 3 — sync_replication_slots](https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-SYNC-REPLICATION-SLOTS)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
