diff --git a/doc/cloning-standbys.xml b/doc/cloning-standbys.xml
index b5dfc490..b96e4901 100644
--- a/doc/cloning-standbys.xml
+++ b/doc/cloning-standbys.xml
@@ -46,6 +46,7 @@
WAL management on the primary becomes much easier as there's no need
to use replication slots, and wal_keep_segments
+ (PostgreSQL 13 and later: wal_keep_size)
does not need to be set.
@@ -234,7 +235,8 @@ description = "Main cluster"
that any standby connected to the primary using a replication slot will always
be able to retrieve the required WAL files. This removes the need to manually
manage WAL file retention by estimating the number of WAL files that need to
- be maintained on the primary using wal_keep_segments.
+ be maintained on the primary using wal_keep_segments
+ (PostgreSQL 13 and later: wal_keep_size).
Do however be aware that if a standby is disconnected, WAL will continue to
accumulate on the primary until either the standby reconnects or the replication
slot is dropped.
diff --git a/doc/configuration.xml b/doc/configuration.xml
index 1abe8982..9a545cbe 100644
--- a/doc/configuration.xml
+++ b/doc/configuration.xml
@@ -270,7 +270,7 @@
-
+ /
@@ -279,25 +279,36 @@
PostgreSQL configuration
+
+
+ wal_keep_size
+ PostgreSQL configuration
+
+
- Normally there is no need to set (default: 0), as it
- is not a reliable way of ensuring that all required WAL segments are available to standbys.
- Replication slots and/or an archiving solution such as Barman are recommended to ensure standbys have a reliable
+ Normally there is no need to set
+ (PostgreSQL 13 and later: wal_keep_size; default: 0),
+ as it is not a reliable way of ensuring that all required WAL
+ segments are available to standbys. Replication slots and/or an archiving solution
+ such as Barman are recommended to ensure standbys have a reliable
source of WAL segments at all times.
- The only reason ever to set is you have
- you have configured
+ The only reason ever to set /
+ is you have you have configured
in repmgr.conf to include the setting --wal-method=fetch
(PostgreSQL 9.6 and earlier: --xlog-method=fetch)
and you have not set
in repmgr.conf to fetch WAL files from a reliable source such as Barman,
in which case you'll need to set
to a sufficiently high number to ensure that all WAL files required by the standby
- are retained. However we do not recommend managing replication in this way.
+ are retained. However we do not recommend WAL retention in this way.
PostgreSQL documentation: wal_keep_segments.
+
diff --git a/doc/repmgr-standby-clone.xml b/doc/repmgr-standby-clone.xml
index 11d274e1..7e0104e3 100644
--- a/doc/repmgr-standby-clone.xml
+++ b/doc/repmgr-standby-clone.xml
@@ -175,7 +175,10 @@
pg_basebackup_options='--wal-method=fetch'
- and ensure that wal_keep_segments is set to an appropriately high value.
+ and ensure that wal_keep_segments (PostgreSQL 13 and later:
+ wal_keep_size) is set to an appropriately high value. Note
+ however that this is not a particularly reliable way of ensuring sufficient
+ WAL is retained and is not recommended.
See the
pg_basebackup documentation for details.
diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c
index 0f6538d4..cdee0c86 100644
--- a/repmgr-action-standby.c
+++ b/repmgr-action-standby.c
@@ -6068,7 +6068,7 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *upstrea
}
/*
* physical replication slots not available or not requested - check if
- * there are any circumstances where `wal_keep_segments` should be set
+ * there are any circumstances where "wal_keep_segments" should be set
*/
else if (mode != barman)
{
@@ -6087,14 +6087,19 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *upstrea
if (check_wal_keep_segments == true)
{
+ const char *wal_keep_parameter_name = "wal_keep_size";
- pg_setting_ok = get_pg_setting_int(conn, "wal_keep_segments", &i);
+ if (PQserverVersion(conn) < 130000)
+ wal_keep_parameter_name = "wal_keep_segments";
+
+ pg_setting_ok = get_pg_setting_int(conn, wal_keep_parameter_name, &i);
if (pg_setting_ok == false || i < 1)
{
if (pg_setting_ok == true)
{
- log_error(_("parameter \"wal_keep_segments\" on the upstream server must be be set to a non-zero value"));
+ log_error(_("parameter \"%s\" on the upstream server must be be set to a non-zero value"),
+ wal_keep_parameter_name);
log_hint(_("Choose a value sufficiently high enough to retain enough WAL "
"until the standby has been cloned and started.\n "
"Alternatively set up WAL archiving using e.g. PgBarman and configure "
@@ -6103,8 +6108,9 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *upstrea
if (server_version_num >= 90400)
{
log_hint(_("In PostgreSQL 9.4 and later, replication slots can be used, which "
- "do not require \"wal_keep_segments\" to be set "
- "(set parameter \"use_replication_slots\" in repmgr.conf to enable)\n"));
+ "do not require \"%s\" to be set "
+ "(set parameter \"use_replication_slots\" in repmgr.conf to enable)\n"),
+ wal_keep_parameter_name);
}
}
@@ -6119,7 +6125,9 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *upstrea
if (pg_setting_ok == true && i > 0 && runtime_options.dry_run == true)
{
- log_info(_("parameter \"wal_keep_segments\" set to %i"), i);
+ log_info(_("parameter \"%s\" set to %i"),
+ wal_keep_parameter_name,
+ i);
}
}
}