Ensure witness server updates its node records following a failover

This involves mainly abstracting the functions which copy
and create records from repmgr.c to dbutils.c, as they need
to be shared between repmgr and repmgrd.

Per issue noted here:

  https://groups.google.com/forum/#!topic/repmgr/v5nu1Xwf6X0
This commit is contained in:
Ian Barwick
2015-03-03 08:57:20 +09:00
parent db5db06244
commit 3d3f082617
4 changed files with 172 additions and 144 deletions

View File

@@ -21,7 +21,7 @@
#define _REPMGR_DBUTILS_H_
#include "strutil.h"
#include "config.h"
PGconn *establish_db_connection(const char *conninfo,
const bool exit_on_error);
@@ -58,5 +58,7 @@ bool create_replication_slot(PGconn *conn, char *slot_name);
bool start_backup(PGconn *conn, char *first_wal_segment);
bool stop_backup(PGconn *conn, char *last_wal_segment);
bool set_config_bool(PGconn *conn, const char *config_param, bool state);
bool copy_configuration(PGconn *masterconn, PGconn *witnessconn, char *cluster_name);
bool create_node_record(PGconn *conn, char *action, int node, char *type, int upstream_node, char *cluster_name, char *node_name, char *conninfo, int priority, char *slot_name);
#endif