canonical / canonical/postgresql-operator

Cannot deploy more than 10 units (max_wal_senders limit)

Open
#801 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
20
Forks
36
Avg merge
4d 15h
Merged PRs (30d)
30

Description

[Same issue in the K8s](https://github.com/canonical/postgresql-k8s-operator/issues/895)

## Steps to reproduce

1. `juju deploy postgresql --channel edge --config profile=testing -n10` and wait them to stabilize
2. `juju add-unit postgresql`

## Expected behavior
Unit is added successfully therefore cluster consists of 11 units.

## Actual behavior

New unit stucks in `awaiting for member to start`.
![Image](https://github.com/user-attachments/assets/c357d658-4a36-465b-be9f-436d77cf7be3)

## Versions

Operating system: Ubuntu 24.04.2 LTS

Juju CLI: 3.6.4-genericlinux-amd64

Juju agent: 3.6.4

Charm revision: 576

LXD: 6.3

## Log output

```
2025-03-19T20:30:09Z systemd[1]: snap.charmed-postgresql.patroni.service: Consumed 2.316s CPU time.
2025-03-19T20:30:09Z systemd[1]: Started Service for snap application charmed-postgresql.patroni.
2025-03-19T20:30:13Z charmed-postgresql.patroni[223680]: pg_basebackup: error: connection to server at "10.88.216.188", port 5432 failed: FATAL: number of requested standby connections exceeds max_wal_senders (currently 10)
2025-03-19T20:30:13Z charmed-postgresql.patroni[223680]: pg_basebackup: removing data directory "/var/snap/charmed-postgresql/common/var/lib/postgresql"
2025-03-19T20:30:20Z charmed-postgresql.patroni[223681]: pg_basebackup: error: connection to server at "10.88.216.188", port 5432 failed: FATAL: number of requested standby connections exceeds max_wal_senders (currently 10)
2025-03-19T20:30:20Z charmed-postgresql.patroni[223681]: pg_basebackup: removing data directory "/var/snap/charmed-postgresql/common/var/lib/postgresql"
2025-03-19T20:30:23Z charmed-postgresql.patroni[223683]: pg_basebackup: error: connection to server at "10.88.216.188", port 5432 failed: FATAL: number of requested standby connections exceeds max_wal_senders (currently 10)
2025-03-19T20:30:23Z charmed-postgresql.patroni[223683]: pg_basebackup: removing data directory "/var/snap/charmed-postgresql/common/var/lib/postgresql"
2025-03-19T20:30:31Z charmed-postgresql.patroni[223778]: pg_basebackup: error: connection to server at "10.88.216.188", port 5432 failed: FATAL: number of requested standby connections exceeds max_wal_senders (currently 10)
2025-03-19T20:30:31Z charmed-postgresql.patroni[223778]: pg_basebackup: removing data directory "/var/snap/charmed-postgresql/common/var/lib/postgresql"
```

## Additional context

I think including `max_wal_senders` and `max_replication_slots` config options will resolve this issue and add an abiltiy to include charm checks based on that value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.