Add a master_response_timeout parameter and use it to limit the amount

of time we spent a reponse from master before declaring the failure.
Also, change is_pgup() so it use PQsendQuery() instead of PQexec to
execute the check of master
This commit is contained in:
Jaime Casanova
2011-12-01 01:20:33 -05:00
parent 89a1e2bcbd
commit 3b2ccc5b78
7 changed files with 107 additions and 52 deletions

View File

@@ -28,7 +28,7 @@ PGconn *establishDBConnectionByParams(const char *keywords[],
const bool exit_on_error);
bool is_standby(PGconn *conn);
bool is_witness(PGconn *conn, char *schema, char *cluster, int node_id);
bool is_pgup(PGconn *conn);
bool is_pgup(PGconn *conn, int timeout);
char *pg_version(PGconn *conn, char* major_version);
bool guc_setted(PGconn *conn, const char *parameter, const char *op,
const char *value);
@@ -36,4 +36,6 @@ const char *get_cluster_size(PGconn *conn);
PGconn *getMasterConnection(PGconn *standby_conn, char *schema, int id, char *cluster,
int *master_id, char *master_conninfo_out);
int wait_connection_availability(PGconn *conn, int timeout);
void CancelQuery(PGconn *conn);
#endif