repmgrd: use PQping() as a first test of whether an upstream node is available

It's possible the upstream node may be temporarily not accepting connections
but is still running, so we only confirm that connections are not possible once
PQping() reports a negative result.

This feature has been adapted from repmgr4.
This commit is contained in:
Ian Barwick
2019-02-22 14:04:37 +09:00
parent 9629fb6eb5
commit 668b2c9b59
3 changed files with 22 additions and 4 deletions

View File

@@ -146,5 +146,6 @@ int get_data_checksum_version(const char *data_directory);
/* backported from repmgr 4.x */
XLogRecPtr parse_lsn(const char *str);
XLogRecPtr get_last_wal_receive_location(PGconn *conn);
bool is_server_available(const char *conninfo);
#endif