canonical / canonical/postgresql-operator

Add ability to configure TTL, Retry threshold parameters for leader election in Patroni

Open
#1,164 7 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

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

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.