juju ssh --container postgresql postgresql-k8s/0 cat /var/lib/postgresql/data/patroni.yml | grep archive
For each unit, it will show archive_command: 'pgbackrest --stanza=dev.patroni-postgresql-k8s archive-push %p'
juju scale-application postgresql-k8s 2 (leader and primary changes)
Wait until cluster stabilizes
Do the step 4, but now see archive_command: /bin/true in the output for each unit
This is related to the leader change or peer relation changed events, i think, because when i do the same test, but instead of removing 2 units (including leader / primary) i just use curl -X POST -d '{"leader": "postgresql-k8s-0", "candidate": "postgresql-k8s-1"}' -H "Content-Type: application/json" http://localhost:8008/switchover (snippet from the integration tests), all the units remain archiving enabled.
This is the same bug I've encountered in VM version of this charm.
Steps to reproduce
juju deploy s3-integrator
and configure itjuju deploy postgresql-k8s --config profile=testing --channel edge --trust -n 4
juju integrate s3-integrator postgresql-k8s
juju ssh --container postgresql postgresql-k8s/0 cat /var/lib/postgresql/data/patroni.yml | grep archive
For each unit, it will showarchive_command: 'pgbackrest --stanza=dev.patroni-postgresql-k8s archive-push %p'
juju scale-application postgresql-k8s 2
(leader and primary changes)archive_command: /bin/true
in the output for each unitExpected behavior
Archiving is still enabled after leader changes.
Actual behavior
Archiving is disables after leader changes.
Versions
Operating system: Ubuntu 24.04 LTS
Juju CLI: 3.5.3-genericlinux-amd64
Juju agent: 3.5.3
Charm revision: 347
microk8s: MicroK8s v1.30.1 revision 6843
Log output
Juju debug log: debug-log
Additional context
This is related to the leader change or peer relation changed events, i think, because when i do the same test, but instead of removing 2 units (including leader / primary) i just use
curl -X POST -d '{"leader": "postgresql-k8s-0", "candidate": "postgresql-k8s-1"}' -H "Content-Type: application/json" http://localhost:8008/switchover
(snippet from the integration tests), all the units remain archiving enabled.