standby clone: handle missing "postgresql.auto.conf"

In PostgreSQL 12 and later we need to append replication configuration
to "postgresql.auto.conf" to guarantee it will be read last, and hence
override any preceding replication configuration which may be haunting
the configuration files.

We've been assuming that "postgresql.auto.conf" will always be present,
but at least one corner case has been observed where that was not the
case on the node being cloned from. Moreover it's perfectly acceptable
that this file does not exist (it will be recreated the next time
ALTER SYSTEM is executed), so we should be prepared to handle that case.

In passing, improve handling of more unlikely errors which might be
encountered when processing "postgresql.auto.conf".
This commit is contained in:
Ian Barwick
2020-10-30 12:17:45 +09:00
parent 36a8dfcf4f
commit 4d3262d306
4 changed files with 36 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
5.2.1 2020-??-??
config: fix parsing of "replication_type"
standby clone: handle missing "postgresql.auto.conf"
5.2.0 2020-10-22
general: add support for PostgreSQL 13 (Ian)