Add "repmgr node status"

Outputs an overview of a node's status, and emits warnings if any
issues detected.
This commit is contained in:
Ian Barwick
2017-07-25 00:12:16 +09:00
parent 93c35618a2
commit 8a2e4db1bc
8 changed files with 290 additions and 11 deletions

View File

@@ -84,6 +84,12 @@ typedef struct s_node_info
PGconn *conn;
/* for ad-hoc use e.g. when working with a list of nodes */
char details[MAXLEN];
/* various statistics */
int max_wal_senders;
int attached_wal_receivers;
int max_replication_slots;
int active_replication_slots;
int inactive_replication_slots;
} t_node_info;
@@ -104,7 +110,8 @@ typedef struct s_node_info
RECTYPE_UNKNOWN, \
MS_NORMAL, \
NULL, \
"" \
"", \
-1, -1, -1, -1, -1 \
}
@@ -306,6 +313,8 @@ bool update_node_record_conn_priority(PGconn *conn, t_configuration_options *op
void clear_node_info_list(NodeInfoList *nodes);
void get_node_replication_stats(PGconn *conn, t_node_info *node_info);
/* event functions */
bool create_event_record(PGconn *conn, t_configuration_options *options, int node_id, char *event, bool successful, char *details);
bool create_event_notification(PGconn *conn, t_configuration_options *options, int node_id, char *event, bool successful, char *details);