canonical / canonical/postgresql-operator
Add ability to configure TTL, Retry threshold parameters for leader election in Patroni
- Dominant language
- Python
- Stars
- 20
- Forks
- 36
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 30
Description
Hello,
During investigation of leader election issues today on Mattermost, we ran into a situation where we wanted to configure settings on Patroni that are not exposed through Juju configuration. I am opening this ticket to request these configuration parameters be made accessible through Juju. This is important to IS to avoid manual work on setting these parameters in DB environments
## Expected behavior
For Patroni config from https://patroni.readthedocs.io/en/latest/dynamic_configuration.html,
Ability to configure retry timeout by running `juju config postgresql patroni_retry_timeout=60`, etc.
## Actual behavior
We need to manually retrieve patroni password from `/var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml` and curl to the patroni endpoint to set this value
```
# Without a relation between PG and any TLS operator.
curl -X PATCH -u user:password http://UNIT-IP:8008/config -d '{"retry_timeout": 60, "ttl": 130}'
# Or with a relation between PG and any TLS operator.
curl -k -X PATCH -u user:password https://UNIT-IP:8008/config -d '{"retry_timeout": 60, "ttl": 130}'
```
## Versions
Environment: dbaas-prod-airbyte-db on PS6 production
Juju CLI: 3.6.9
Juju agent: 3.6.9
Charm revision: 553 (14/stable)
## Additional context
Discussed [on mattermost here](https://chat.canonical.com/canonical/pl/by3grtibptruukmix935k39q9r)
Contributor guide
Assessment
This issue has not been assessed yet.