Skip to content

Question: Running with wal_level = logical? #1030

Open

Description

@wilsoniya

Hi there, I'm looking to set up logical replication for change data capture. This requires running postgres with wal_level = logical per the postgres docs: https://www.postgresql.org/docs/14/logical-replication-config.html ; is it possible for pg_auto_failover to operate with wal_level = logical?

Please note, I'm not looking to get pg_auto_failover cluster members to replicate via logical replication as was discussed in #400, and I'm not concerned at this time with failing over logical replication slots; I understand that's not supported in its entirety yet.

  • If it's possible to run pg_auto_failover with wal_level = logical, how can this configuration be set? It seems like pg_auto_failover manages this configuration.
  • Do you foresee any complications transitioning an existing formation from replica -> logical wal_level? Can the transition just be made by modifying config files and restarting the servers?

Activity

  1. changed the title [-]Running with wal_level = logical[/-] [+]Question: Running with wal_level = logical?[/+] on Mar 15, 2024
  2. dimitri commented on Oct 14, 2026

    @dimitri
    Contributor

    This is now fully supported as of PR #1197:

    • wal_level now defaults to logical for new formations running Postgres 17+.
    • For an existing formation, there's now a documented runbook for the transition — see the wal_level_rollout section in docs/cdc.rst. It relies on the new pg_autoctl restart postgres --maintenance command (PR Add pg_autoctl restart postgres: safe, maintenance-aware Postgres restart #1198) to apply the setting change and restart each node without triggering a failover.
    • Logical replication slots on the primary now survive failover/switchover via synchronized_standby_slots, so a CDC consumer (e.g. a Debezium/logical-replication subscriber) doesn't lose its slot when the primary changes.

    This hasn't shipped in a release yet — it's merged to main and should land in the next pg_auto_failover release, probably in November. See docs/cdc.rst for the full design and current limitations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions