[Feature Request] Expose `backups.target` option so users may choose to backup from the primary instance
This request comes as an output of this issue: https://github.com/cloudnative-pg/cloudnative-pg/issues/10416
When taking on-demand-backups, a user will not be able to successfully recover from that backup unless:
1. Another `INSERT` command is run to for a sync of the WAL on a standby replica
2. A SUPERUSER calls `SELECT pg_switch_wal();` on the primary replica to force the creation of a new WAL file.
3. The `backup.target` is set to `primary`
While probably not an issue for very busy databases, this caught me out on some DBs that have very infrequent usage.
Exposing `backup.target` is preferable from a security perspective because the user does not need to access and account with the `SUPERUSER` roll. It also is operationally less complex than creating an automated task to run an `INSERT` or `SELECT pg_switch_wal();` after each backup.
PR here: https://github.com/cloudnative-pg/charts/pull/847
3 条评论