Handle failover of top-level standby

Cascaded standbys will not go into failover so we need to ignore
these when looking for candidates for promotion.
This commit is contained in:
Ian Barwick
2015-01-16 12:35:01 +09:00
parent a82d37e48a
commit 609453a848
4 changed files with 123 additions and 13 deletions

View File

@@ -388,6 +388,7 @@ get_cluster_size(PGconn *conn, char *size)
}
bool
get_pg_setting(PGconn *conn, const char *setting, char *output)
{
@@ -467,7 +468,7 @@ get_upstream_connection(PGconn *standby_conn, char *cluster, int node_id,
cluster,
node_id);
log_debug("%s", sqlquery);
log_debug("%s\n", sqlquery);
res = PQexec(standby_conn, sqlquery);