Change return type of is_downstream_node_attached() from bool to NodeAttached

This enables us to better determine whether a node is definitively
attached, definitively not attached, or if it was not possible to
determine the attached state.
This commit is contained in:
Ian Barwick
2019-05-14 15:53:46 +09:00
parent 7599afce8b
commit dd78a16006
4 changed files with 26 additions and 17 deletions

View File

@@ -118,6 +118,7 @@ typedef enum
} BackupState;
/*
* Struct to store extension version information
*/
@@ -574,7 +575,7 @@ void init_replication_info(ReplInfo *replication_info);
bool get_replication_info(PGconn *conn, t_server_type node_type, ReplInfo *replication_info);
int get_replication_lag_seconds(PGconn *conn);
void get_node_replication_stats(PGconn *conn, t_node_info *node_info);
bool is_downstream_node_attached(PGconn *conn, char *node_name);
NodeAttached is_downstream_node_attached(PGconn *conn, char *node_name);
void set_upstream_last_seen(PGconn *conn, int upstream_node_id);
int get_upstream_last_seen(PGconn *conn, t_server_type node_type);