~cjwatson/postgresql-charm:master

Last commit made on 2023-11-09
Get this branch:
git clone -b master https://git.launchpad.net/~cjwatson/postgresql-charm
Only Colin Watson can upload to this branch. If you are Colin Watson please log in for upload directions.

Branch merges

Branch information

Name:
master
Repository:
lp:~cjwatson/postgresql-charm

Recent commits

503618d... by Colin Misare

updating maintainers field to be a URL

Reviewed-on: https://code.launchpad.net/~cmisare/postgresql-charm/+git/postgresql-charm/+merge/455390
Reviewed-by: 🤖 Canonical IS Review Bot <email address hidden>

72576c5... by Colin Misare

updating maintainers field to be a URL

b771488... by Colin Watson

Fix WAL-E backups in the manual replication case

Reviewed-on: https://code.launchpad.net/~cjwatson/postgresql-charm/+git/postgresql-charm/+merge/455221
Reviewed-by: Colin Misare <email address hidden>

4853c41... by Colin Watson

Fix WAL-E backups in the manual replication case

This charm has two closely related concepts: "master" and "primary".
The master is elected using Juju leadership, though may still be in the
process of being promoted at the PostgreSQL level; the primary flag
indicates that the unit is not configured to be a replica.

In manual replication mode, no unit is the master, but there may be
units that are primaries. The documentation for the
`postgresql.replication.is_primary` reactive flag says "The unit is
writable. It is either the master or manual replication mode is in
effect."

We observed that in manual replication mode the WAL-E backups are
currently useless, because they have WAL but no basebackups that the WAL
might be applied to. It seems to make most sense to run basebackups
based on `is_primary` rather than `is_master`; this should leave
behaviour unchanged in the default managed replication mode.

e3f064a... by Colin Watson

pgbackup.py: Avoid leaving partial backups if pg_dump is interrupted

Reviewed-on: https://code.launchpad.net/~cjwatson/postgresql-charm/+git/postgresql-charm/+merge/448727
Reviewed-by: Haw Loeung <email address hidden>

78c1da3... by Colin Watson

pgbackup.py: Exclude slony schema from dumps

Reviewed-on: https://code.launchpad.net/~cjwatson/postgresql-charm/+git/postgresql-charm/+merge/448728
Reviewed-by: Haw Loeung <email address hidden>

cabebd9... by Colin Watson

pgbackup.py: Exclude slony schema from dumps

Copied from
https://bazaar.launchpad.net/~canonical-losas/losa-db-scripts/trunk/revision/7.1.8.
I considered making this configurable, but it seems non-invasive enough
that I don't think it's really worth the extra configuration surface.

19dab3c... by Colin Watson

pgbackup.py: Avoid leaving partial backups if pg_dump is interrupted

It's sometimes necessary to interrupt a daily pg_dump in order to
complete other database maintenance tasks. However, doing so results in
a partial backup file, which can result in problems if that file is
automatically restored to another system (for example, Launchpad's
staging instance works this way).

To avoid this problem, write dumps to a file whose name starts with
"partial-" (chosen to minimize the chances of scripts confusing such
files with complete backups, since the file names start with the
database name and restore scripts typically specify that), and only
rename them into place once the dump completes successfully.

4f4bbc7... by Barry Price

Linting

Reviewed-on: https://code.launchpad.net/~barryprice/postgresql-charm/+git/postgresql-charm/+merge/446387
Reviewed-by: 🤖 Canonical IS Review Bot <email address hidden>

59b1cb5... by Barry Price

Linting