mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
Minimum supported version is currently 9.4
This commit is contained in:
@@ -10,7 +10,7 @@ operations.
|
|||||||
`repmgr 4` is a complete rewrite of the existing `repmgr` codebase.
|
`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.
|
may be supported if feasible.
|
||||||
|
|
||||||
Building from source
|
Building from source
|
||||||
|
|||||||
@@ -1628,21 +1628,6 @@ check_source_server()
|
|||||||
log_detail(_("current installation size is %s"),
|
log_detail(_("current installation size is %s"),
|
||||||
cluster_size);
|
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
|
* If the upstream node is a standby, try to connect to the primary too so we
|
||||||
* can write an event record
|
* can write an event record
|
||||||
@@ -1916,13 +1901,6 @@ initialise_direct_clone(void)
|
|||||||
{
|
{
|
||||||
TablespaceListCell *cell;
|
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)
|
for (cell = config_file_options.tablespace_mapping.head; cell; cell = cell->next)
|
||||||
{
|
{
|
||||||
char *old_dir_escaped = escape_string(source_conn, cell->old_dir);
|
char *old_dir_escaped = escape_string(source_conn, cell->old_dir);
|
||||||
|
|||||||
@@ -1649,12 +1649,6 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
|
|||||||
xlog_stream = false;
|
xlog_stream = false;
|
||||||
|
|
||||||
/* Check that WAL level is set correctly */
|
/* 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[] = {
|
char *levels_pre96[] = {
|
||||||
"hot_standby",
|
"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 || i == -1)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
log_error("%s",
|
{
|
||||||
wal_error_message);
|
log_error("%s", wal_error_message);
|
||||||
|
}
|
||||||
|
|
||||||
if (exit_on_error == true)
|
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)
|
if (config_file_options.use_replication_slots)
|
||||||
{
|
{
|
||||||
/* Does the server support physical replication slots? */
|
i = guc_set_typed(conn, "max_replication_slots", ">",
|
||||||
if (server_version_num < 90400)
|
"0", "integer");
|
||||||
|
if (i == 0 || i == -1)
|
||||||
{
|
{
|
||||||
log_error(_("server version must be 9.4 or later to enable replication slots"));
|
if (i == 0)
|
||||||
|
|
||||||
if (exit_on_error == true)
|
|
||||||
{
|
{
|
||||||
PQfinish(conn);
|
log_error(_("parameter \"max_replication_slots\" must be set to at least 1 to enable replication slots"));
|
||||||
exit(ERR_BAD_CONFIG);
|
log_hint(_("\"max_replication_slots\" should be set to at least the number of expected standbys"));
|
||||||
}
|
if (exit_on_error == true)
|
||||||
|
|
||||||
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"));
|
PQfinish(conn);
|
||||||
log_hint(_("'max_replication_slots' should be set to at least the number of expected standbys"));
|
exit(ERR_BAD_CONFIG);
|
||||||
if (exit_on_error == true)
|
|
||||||
{
|
|
||||||
PQfinish(conn);
|
|
||||||
exit(ERR_BAD_CONFIG);
|
|
||||||
}
|
|
||||||
|
|
||||||
config_ok = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config_ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* physical replication slots not available or not requested - check if
|
* 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 || i == -1)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
|
{
|
||||||
log_error(_("parameter 'hot_standby' must be set to 'on'"));
|
log_error(_("parameter 'hot_standby' must be set to 'on'"));
|
||||||
|
}
|
||||||
|
|
||||||
if (exit_on_error == true)
|
if (exit_on_error == true)
|
||||||
{
|
{
|
||||||
|
|||||||
4
repmgr.h
4
repmgr.h
@@ -19,8 +19,8 @@
|
|||||||
#include "dbutils.h"
|
#include "dbutils.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#define MIN_SUPPORTED_VERSION "9.3"
|
#define MIN_SUPPORTED_VERSION "9.4"
|
||||||
#define MIN_SUPPORTED_VERSION_NUM 90300
|
#define MIN_SUPPORTED_VERSION_NUM 90400
|
||||||
#define UNKNOWN_SERVER_VERSION_NUM -1
|
#define UNKNOWN_SERVER_VERSION_NUM -1
|
||||||
|
|
||||||
#define NODE_NOT_FOUND -1
|
#define NODE_NOT_FOUND -1
|
||||||
|
|||||||
Reference in New Issue
Block a user