aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2020-07-20 13:30:18 +0900
committerFujii Masao <fujii@postgresql.org>2020-07-20 13:30:18 +0900
commitc3fe108c025e4a080315562d4c15ecbe3f00405e (patch)
treeb70e9db2e58fedb9abd6506574629f1e5ca75386 /src/backend/utils/misc/guc.c
parent0bead9af484c1d0a67e690fda47011addaa5bc9d (diff)
downloadpostgresql-c3fe108c025e4a080315562d4c15ecbe3f00405e.tar.gz
postgresql-c3fe108c025e4a080315562d4c15ecbe3f00405e.zip
Rename wal_keep_segments to wal_keep_size.
max_slot_wal_keep_size that was added in v13 and wal_keep_segments are the GUC parameters to specify how much WAL files to retain for the standby servers. While max_slot_wal_keep_size accepts the number of bytes of WAL files, wal_keep_segments accepts the number of WAL files. This difference of setting units between those similar parameters could be confusing to users. To alleviate this situation, this commit renames wal_keep_segments to wal_keep_size, and make users specify the WAL size in it instead of the number of WAL files. There was also the idea to rename max_slot_wal_keep_size to max_slot_wal_keep_segments, in the discussion. But we have been moving away from measuring in segments, for example, checkpoint_segments was replaced by max_wal_size. So we concluded to rename wal_keep_segments to wal_keep_size. Back-patch to v13 where max_slot_wal_keep_size was added. Author: Fujii Masao Reviewed-by: Álvaro Herrera, Kyotaro Horiguchi, David Steele Discussion: https://postgr.es/m/574b4ea3-e0f9-b175-ead2-ebea7faea855@oss.nttdata.com
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 99a3e4f6f65..6f603cbbe8c 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -2636,12 +2636,13 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"wal_keep_segments", PGC_SIGHUP, REPLICATION_SENDING,
- gettext_noop("Sets the number of WAL files held for standby servers."),
- NULL
+ {"wal_keep_size", PGC_SIGHUP, REPLICATION_SENDING,
+ gettext_noop("Sets the size of WAL files held for standby servers."),
+ NULL,
+ GUC_UNIT_MB
},
- &wal_keep_segments,
- 0, 0, INT_MAX,
+ &wal_keep_size_mb,
+ 0, 0, MAX_KILOBYTES,
NULL, NULL, NULL
},