mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
use a constant to denote unknown replication lag
This commit is contained in:
@@ -5050,13 +5050,12 @@ get_replication_lag_seconds(PGconn *conn)
|
|||||||
log_warning("%s", PQerrorMessage(conn));
|
log_warning("%s", PQerrorMessage(conn));
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
/* XXX magic number */
|
return UNKNOWN_REPLICATION_LAG;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PQntuples(res))
|
if (!PQntuples(res))
|
||||||
{
|
{
|
||||||
return -1;
|
return UNKNOWN_REPLICATION_LAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
lag_seconds = atoi(PQgetvalue(res, 0, 0));
|
lag_seconds = atoi(PQgetvalue(res, 0, 0));
|
||||||
|
|||||||
@@ -1408,7 +1408,7 @@ do_node_check_replication_lag(PGconn *conn, OutputMode mode, t_node_info *node_i
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lag_seconds < 0)
|
else if (lag_seconds == UNKNOWN_REPLICATION_LAG)
|
||||||
{
|
{
|
||||||
status = CHECK_STATUS_UNKNOWN;
|
status = CHECK_STATUS_UNKNOWN;
|
||||||
|
|
||||||
|
|||||||
@@ -3883,7 +3883,7 @@ do_standby_switchover(void)
|
|||||||
log_detail(_("lag is %i seconds (warning threshold: %i)"),
|
log_detail(_("lag is %i seconds (warning threshold: %i)"),
|
||||||
lag_seconds, config_file_options.replication_lag_warning);
|
lag_seconds, config_file_options.replication_lag_warning);
|
||||||
}
|
}
|
||||||
else if (lag_seconds < 0)
|
else if (lag_seconds == UNKNOWN_REPLICATION_LAG)
|
||||||
{
|
{
|
||||||
if (runtime_options.force == false)
|
if (runtime_options.force == false)
|
||||||
{
|
{
|
||||||
|
|||||||
1
repmgr.h
1
repmgr.h
@@ -55,6 +55,7 @@
|
|||||||
#define UNKNOWN_TIMELINE_ID -1
|
#define UNKNOWN_TIMELINE_ID -1
|
||||||
#define UNKNOWN_SYSTEM_IDENTIFIER 0
|
#define UNKNOWN_SYSTEM_IDENTIFIER 0
|
||||||
#define UNKNOWN_PID -1
|
#define UNKNOWN_PID -1
|
||||||
|
#define UNKNOWN_REPLICATION_LAG -1
|
||||||
|
|
||||||
#define NODE_NOT_FOUND -1
|
#define NODE_NOT_FOUND -1
|
||||||
#define NO_UPSTREAM_NODE -1
|
#define NO_UPSTREAM_NODE -1
|
||||||
|
|||||||
Reference in New Issue
Block a user