summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorThomas Munro2019-04-02 01:37:14 +0000
committerThomas Munro2019-04-02 01:37:14 +0000
commit475861b2615dd63ae8431d811749a6f9a15bbfd6 (patch)
treedf88475a55eaa2bf359000628325d7b798f90521 /src/backend/utils
parent4b82664156c230b59607704506f5b0a32ef490a2 (diff)
Add wal_recycle and wal_init_zero GUCs.
On at least ZFS, it can be beneficial to create new WAL files every time and not to bother zero-filling them. Since it's not clear which other filesystems might benefit from one or both of those things, add individual GUCs to control those two behaviors independently and make only very general statements in the docs. Author: Jerry Jelinek, with some adjustments by Thomas Munro Reviewed-by: Alvaro Herrera, Andres Freund, Tomas Vondra, Robert Haas and others Discussion: https://postgr.es/m/CACPQ5Fo00QR7LNAcd1ZjgoBi4y97%2BK760YABs0vQHH5dLdkkMA%40mail.gmail.com
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/misc/guc.c20
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample2
2 files changed, 22 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index aa564d153a5..cd5a65be75b 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1175,6 +1175,26 @@ static struct config_bool ConfigureNamesBool[] =
},
{
+ {"wal_init_zero", PGC_SUSET, WAL_SETTINGS,
+ gettext_noop("Writes zeroes to new WAL files before first use."),
+ NULL
+ },
+ &wal_init_zero,
+ true,
+ NULL, NULL, NULL
+ },
+
+ {
+ {"wal_recycle", PGC_SUSET, WAL_SETTINGS,
+ gettext_noop("Recycles WAL files by renaming them."),
+ NULL
+ },
+ &wal_recycle,
+ true,
+ NULL, NULL, NULL
+ },
+
+ {
{"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT,
gettext_noop("Logs each checkpoint."),
NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index cccb5f145a2..9b15361403e 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -206,6 +206,8 @@
#wal_compression = off # enable compression of full-page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
+#wal_init_zero = on # zero-fill new WAL files
+#wal_recycle = on # recycle WAL files
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds