repmgrd: return predictable default values for get_primary_last_seen()

Return 0 if the node is not in recovery. In which case it's probably
rather pointless calling this function anyway.

Return -1 if the "last_seen" field has never been set (i.e. repmgrd
hasn't started yet).
This commit is contained in:
Ian Barwick
2018-11-21 10:18:00 +09:00
parent 0caec90d81
commit 784c9c4793
2 changed files with 17 additions and 2 deletions

View File

@@ -3168,6 +3168,7 @@ is_downstream_node_attached(PGconn *conn, char *node_name)
return true;
}
void
set_primary_last_seen(PGconn *conn)
{