Clarify upstream role in log messages

This commit is contained in:
Ian Barwick
2015-01-27 12:39:39 +09:00
parent f8639a7878
commit 7e4c26b8a0

View File

@@ -647,8 +647,9 @@ standby_monitor(void)
PGconn *upstream_conn; PGconn *upstream_conn;
int upstream_node_id; int upstream_node_id;
t_node_info upstream_node; t_node_info upstream_node;
const char *type = NULL;
/* /*
* Verify that the local node is still available - if not there's * Verify that the local node is still available - if not there's
* no point in doing much else anyway * no point in doing much else anyway
@@ -671,6 +672,9 @@ standby_monitor(void)
local_options.node, local_options.node,
&upstream_node_id, NULL); &upstream_node_id, NULL);
type = upstream_node_id == primary_options.node
? "master"
: "upstream";
// ZZZ "5 minutes"? // ZZZ "5 minutes"?
/* /*
@@ -678,12 +682,10 @@ standby_monitor(void)
* we cannot reconnect, try to get a new upstream node. * we cannot reconnect, try to get a new upstream node.
*/ */
// ZZZ change "master" to "upstream" if connected to cascading standby check_connection(upstream_conn, type); /* this takes up to
check_connection(upstream_conn, "master"); /* this take up to * local_options.reconnect_attempts
* local_options.reconnect_atte * local_options.reconnect_intvl seconds
* mpts * */
* local_options.reconnect_intv
* l seconds */
if (PQstatus(upstream_conn) != CONNECTION_OK) if (PQstatus(upstream_conn) != CONNECTION_OK)
@@ -693,7 +695,7 @@ standby_monitor(void)
if (local_options.failover == MANUAL_FAILOVER) if (local_options.failover == MANUAL_FAILOVER)
{ {
log_err(_("We couldn't reconnect to master. Now checking if another node has been promoted.\n")); log_err(_("We couldn't reconnect to %s. Now checking if another node has been promoted.\n"), type);
for (connection_retries = 0; connection_retries < local_options.reconnect_attempts; connection_retries++) for (connection_retries = 0; connection_retries < local_options.reconnect_attempts; connection_retries++)
{ {