canonical / canonical/postgresql-operator

Allow create-backup on non-primary even when no TLS configured

Open
#716 4 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

## Steps to reproduce
1. `juju deploy postgresql --channel 14/stable`
2. `juju add-unit postgresql -n 2`
3. `juju run $(juju status postgresql | grep '^postgresql/' | grep -v 'Primary' | head -n1 | awk '{ print $1 }' | cut -d'*' -f1) create-backup

## Expected behavior

Backup successfully runs

## Actual behavior

`Action id 68 failed: Unit cannot perform backups as TLS is not enabled`

## Versions

Operating system: Ubuntu

Juju CLI: 3.6.1-ubuntu-amd64

Juju agent: 3.6.1

Charm revision: 468

## Additional context

Per the docs - https://charmhub.io/postgresql/docs/h-create-backup

```
Tip: To avoid unnecessary service downtime, always use non-primary units for the action create-backup
```

However:

```
Keep in mind that:

When TLS is enabled, create-backup can only run on replicas (non-primary)
When TLS is not enabled, create-backup can only run in the primary unit
```

Why is it that when TLS is not enabled, we can't trigger the backups on the non-primary unit? This limitation means we can't try to avoid unnecessary service downtime by running backups on the non-primary per the `Tip`.

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.