repmgr: initialise "voting_term" in "repmgr primary register"

This previously happened in the extension SQL code, which could
potentially cause replay problems if installing on a BDR cluster.

As this table is only required for streaming replication failover,
move the initialisation to "repmgr primary register".

Addresses GitHub #344 .
This commit is contained in:
Ian Barwick
2017-11-28 10:51:32 +09:00
parent de34e4e89b
commit 472d703d2e
5 changed files with 40 additions and 8 deletions

View File

@@ -473,6 +473,7 @@ bool delete_monitoring_records(PGconn *primary_conn, int keep_history);
/* node voting functions */
void initialize_voting_term(PGconn *conn);
int get_current_term(PGconn *conn);
void increment_current_term(PGconn *conn);
bool announce_candidature(PGconn *conn, t_node_info *this_node, t_node_info *other_node, int electoral_term);