Skip to content

[DPE-9962] Rename default Patroni config to avoid missconfigurations#271

Open
taurus-forever wants to merge 1 commit into
16/edgefrom
alutay/snap_rm_conf
Open

[DPE-9962] Rename default Patroni config to avoid missconfigurations#271
taurus-forever wants to merge 1 commit into
16/edgefrom
alutay/snap_rm_conf

Conversation

@taurus-forever
Copy link
Copy Markdown
Contributor

Issue

Sometimes, due to complex deployment instabilities, Charmed PostgreSQL snap can be installed already on machine by charm.py operator and launched by systemd/snapd on reboot, etc... effectively staring with wrong configs.

Solution

Rename default config to avoid Patroni staring with wrong config paramts.
If config file is missing, Patroni failfast causing no damage/garbage in pgdata.

Could removed completely, but one day we hope to ship it usable without the charm.

@taurus-forever taurus-forever requested a review from a team as a code owner April 29, 2026 10:26
@taurus-forever taurus-forever requested review from carlcsaposs-canonical, dragomirp, juju-charm-bot and marceloneppel and removed request for a team April 29, 2026 10:26
@taurus-forever taurus-forever added the bug Something isn't working as expected label Apr 29, 2026
Copy link
Copy Markdown
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should

cp "${SNAP}/config/patroni.yaml" "${SNAP_DATA}/etc/patroni"
be removed as well?

@taurus-forever
Copy link
Copy Markdown
Contributor Author

Should

cp "${SNAP}/config/patroni.yaml" "${SNAP_DATA}/etc/patroni"

be removed as well?

This is an excellent catch! Thank you!
Should we also add there set -eo pipefail into install hook... and all shell scripts?

@taurus-forever taurus-forever marked this pull request as draft April 29, 2026 20:17
@marceloneppel
Copy link
Copy Markdown
Member

Should we also add there set -eo pipefail into install hook... and all shell scripts?

I think it's worth adding.

…urations

Sometimes, due to complex deployment instabilities, Charmed PostgreSQL snap
can be installed already on machine by charm.py operator and launched by
systemd/snapd on reboot, etc... effectively staring with wrong configs.

The file could be removed completely, but one day we hope to ship rock usable without the charm.

If config file is missing, Patroni failfast causing no damage/garbage in pgdata.
@taurus-forever
Copy link
Copy Markdown
Contributor Author

re: set -eo pipefail

It will be the followup work, as we see a bunch of necessary changes (e.g. chown will fain on new installation, etc), let's keep commits atomic.

@taurus-forever taurus-forever changed the title DPE-9962 Rename default Patroni config to avoid missconfigurations [DPE-9962] Rename default Patroni config to avoid missconfigurations May 26, 2026
@taurus-forever taurus-forever marked this pull request as ready for review May 26, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants