Minimum supported version is currently 9.4

This commit is contained in:
Ian Barwick
2017-06-25 21:46:50 +09:00
parent b64581c582
commit 7845a1fb47
4 changed files with 19 additions and 62 deletions

View File

@@ -10,7 +10,7 @@ operations.
`repmgr 4` is a complete rewrite of the existing `repmgr` codebase.
Supports PostgreSQL 9.6 and later; support for 9.3 will be dropped, 9.4/9.5
Supports PostgreSQL 9.6 and later; support for 9.3 has been dropped, 9.4/9.5
may be supported if feasible.
Building from source

View File

@@ -1628,21 +1628,6 @@ check_source_server()
log_detail(_("current installation size is %s"),
cluster_size);
/*
* If --recovery-min-apply-delay was passed, check that
* we're connected to PostgreSQL 9.4 or later
*/
// XXX should this be a config file parameter?
if (*runtime_options.recovery_min_apply_delay)
{
if (server_version_num < 90400)
{
log_error(_("PostgreSQL 9.4 or greater required for --recovery-min-apply-delay"));
PQfinish(source_conn);
exit(ERR_BAD_CONFIG);
}
}
/*
* If the upstream node is a standby, try to connect to the primary too so we
* can write an event record
@@ -1916,13 +1901,6 @@ initialise_direct_clone(void)
{
TablespaceListCell *cell;
if (server_version_num < 90400)
{
log_error(_("tablespace mapping is not supported for PostgreSQL 9.3"));
PQfinish(source_conn);
exit(ERR_BAD_CONFIG);
}
for (cell = config_file_options.tablespace_mapping.head; cell; cell = cell->next)
{
char *old_dir_escaped = escape_string(source_conn, cell->old_dir);

View File

@@ -1649,12 +1649,6 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
xlog_stream = false;
/* Check that WAL level is set correctly */
if (server_version_num < 90400)
{
i = guc_set(conn, "wal_level", "=", "hot_standby");
wal_error_message = _("parameter 'wal_level' must be set to 'hot_standby'");
}
else
{
char *levels_pre96[] = {
"hot_standby",
@@ -1700,8 +1694,9 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
if (i == 0 || i == -1)
{
if (i == 0)
log_error("%s",
wal_error_message);
{
log_error("%s", wal_error_message);
}
if (exit_on_error == true)
{
@@ -1714,41 +1709,23 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
if (config_file_options.use_replication_slots)
{
/* Does the server support physical replication slots? */
if (server_version_num < 90400)
i = guc_set_typed(conn, "max_replication_slots", ">",
"0", "integer");
if (i == 0 || i == -1)
{
log_error(_("server version must be 9.4 or later to enable replication slots"));
if (exit_on_error == true)
if (i == 0)
{
PQfinish(conn);
exit(ERR_BAD_CONFIG);
}
config_ok = false;
}
/* Server is 9.4 or greater - non-zero `max_replication_slots` required */
else
{
i = guc_set_typed(conn, "max_replication_slots", ">",
"0", "integer");
if (i == 0 || i == -1)
{
if (i == 0)
log_error(_("parameter \"max_replication_slots\" must be set to at least 1 to enable replication slots"));
log_hint(_("\"max_replication_slots\" should be set to at least the number of expected standbys"));
if (exit_on_error == true)
{
log_error(_("parameter 'max_replication_slots' must be set to at least 1 to enable replication slots"));
log_hint(_("'max_replication_slots' should be set to at least the number of expected standbys"));
if (exit_on_error == true)
{
PQfinish(conn);
exit(ERR_BAD_CONFIG);
}
config_ok = false;
PQfinish(conn);
exit(ERR_BAD_CONFIG);
}
config_ok = false;
}
}
}
/*
* physical replication slots not available or not requested - check if
@@ -1856,7 +1833,9 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
if (i == 0 || i == -1)
{
if (i == 0)
{
log_error(_("parameter 'hot_standby' must be set to 'on'"));
}
if (exit_on_error == true)
{

View File

@@ -19,8 +19,8 @@
#include "dbutils.h"
#include "log.h"
#define MIN_SUPPORTED_VERSION "9.3"
#define MIN_SUPPORTED_VERSION_NUM 90300
#define MIN_SUPPORTED_VERSION "9.4"
#define MIN_SUPPORTED_VERSION_NUM 90400
#define UNKNOWN_SERVER_VERSION_NUM -1
#define NODE_NOT_FOUND -1