Ensure BDR-specific code only runs on BDR 2.x

The BDR support in repmgr is for a specific BDR 2.x use case, and
is not suitable for more recent BDR versions.
This commit is contained in:
Ian Barwick
2019-04-05 14:32:55 +09:00
parent c338bc9c5e
commit a8d560860d
2 changed files with 21 additions and 0 deletions

View File

@@ -96,9 +96,21 @@ monitor_bdr(void)
if (!is_bdr_db(local_conn, NULL))
{
log_error(_("database is not BDR-enabled"));
PQfinish(local_conn);
exit(ERR_BAD_CONFIG);
}
/*
* Check this is a supported BDR version (basically BDR 2.x)
*/
if (get_bdr_version_num() > 2)
{
log_error(_("\"bdr\" mode is for BDR 2.x only"));
log_hint(_("for BDR 3 and later, use \"replication_type=physical\""));
log_error(_("database is not BDR-enabled"));
exit(ERR_DB_CONN);
}
if (is_table_in_bdr_replication_set(local_conn, "nodes", "repmgr") == false)
{
log_error(_("repmgr metadata table 'repmgr.%s' is not in the 'repmgr' replication set"),