Skip to content

Conversation

@PavelZaytsev
Copy link

@PavelZaytsev PavelZaytsev commented Dec 24, 2025

Motivation

PostgreSQL 17 introduced native logical replication slot synchronization, where logical slots are synced to standby servers. However, if both enabled, Patroni's logical slot failover inteferes resulting in a faulty behavior. This PR adds support for Patroni's ignore_slots DCS configuration to allow operators to exclude specific slot types (e.g., logical slots) from failover blocking.

Implementation

  • Add ignore_slots field to Patroni struct in CRD
  • Add ignore_slots to patroniDCS struct for Spilo configuration
  • Generate ignore_slots in SPILO_CONFIGURATION when specified
  • Update CRD manifest to accept ignore_slots field
  • Add unit test for ignore_slots configuration

This enables PostgreSQL 17 (and user-defined) slot synchronization support by allowing users to configure Patroni to ignore specific replication slot types (e.g., logical slots) during failover operations.

Users can now configure ignore_slots in their PostgreSQL manifest:

  patroni:
    ignore_slots:
      - type: logical

This instructs Patroni to ignore logical replication slots during failover.

Testing

  • Added unit test in k8sres_test.go for ignore_slots configuration
  • All existing tests pass
  • Manually verified in live cluster that ignore_slots appears in:
    • PostgreSQL CRD spec
    • SPILO_CONFIGURATION environment variable
    • Patroni's live configuration (patronictl show-config)

- Add ignore_slots field to Patroni struct in CRD
- Add ignore_slots to patroniDCS struct for Spilo configuration
- Generate ignore_slots in SPILO_CONFIGURATION when specified
- Update CRD manifest to accept ignore_slots field
- Add unit test for ignore_slots configuration

This enables PostgreSQL 17 native slot synchronization support by allowing
users to configure Patroni to ignore specific replication slot types (e.g.,
logical slots) during failover operations.

Users can now configure ignore_slots in their PostgreSQL manifest:

  patroni:
    ignore_slots:
      - type: logical

This instructs Patroni to ignore logical replication slots during failover,
which is essential for PostgreSQL 17's native logical slot synchronization
feature where slots are automatically synced to standbys.
@zalando-robot
Copy link

Cannot start a pipeline due to:

No accountable user for this pipeline: no Zalando employee associated to this GitHub username

Click on pipeline status check Details link below for more information.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants